Skip to main content

SUM function

 The SUM function adds values. You can add individual values, cell references or ranges or a mix of all three.

For example:

  • =SUM(A2:A10) Adds the values in cells A2:10.

  • =SUM(A2:A10, C2:C10) Adds the values in cells A2:10, as well as cells C2:C10.

SUM(number1,[number2],...)

Argument name

Description

number1   

Required

The first number you want to add. The number can be like 4, a cell reference like B6, or a cell range like B2:B8.

number2-255   

Optional

This is the second number you want to add. You can specify up to 255 numbers in this way.

This section will discuss some best practices for working with the SUM function. Much of this can be applied to working with other functions as well.

The =1+2 or =A+B Method – While you can enter =1+2+3 or =A1+B1+C2 and get fully accurate results, these methods are error prone for several reasons:

  1. Typos – Imagine trying to enter more and/or much larger values like this:

    • =14598.93+65437.90+78496.23

    Then try to validate that your entries are correct. It’s much easier to put these values in individual cells and use a SUM formula. In addition, you can format the values when they’re in cells, making them much more readable then when they’re in a formula.

    Use the SUM function instead of hard-coding values in formulas.  Formula in cell D5 is =SUM(D2:D4)
  2. #VALUE! errors from referencing text instead of numbers

    If you use a formula like:

    • =A1+B1+C1 or =A1+A2+A3

    Example of poor formula construction.  Formula in cell D2 is =A2+B2+C2

    Your formula can break if there are any non-numeric (text) values in the referenced cells, which will return a #VALUE! error. SUM will ignore text values and give you the sum of just the numeric values.

    Proper formula construction.  Instead of =A2+B2+C2, cell D2's formula is =SUM(A2:C2)
  3. #REF! error from deleting rows or columns

    #REF! error caused by deleting a column.  Formula has changed to =A2+#REF!+B2

    If you delete a row or column, the formula will not update to exclude the deleted row and it will return a #REF! error, where a SUM function will automatically update.

    SUM function will automatically adjust for inserted or deleted rows and columns
  4. Formulas won't update references when inserting rows or columns

    =A+B+C formulas won't update if you add rows

    If you insert a row or column, the formula will not update to include the added row, where a SUM function will automatically update (as long as you’re not outside of the range referenced in the formula). This is especially important if you expect your formula to update and it doesn’t, as it will leave you with incomplete results that you might not catch.

    Example portrays a SUM formula automatically expanding from =SUM(A2:C2) to =SUM(A2:D2) when a column was inserted
  5. SUM with individual Cell References vs. Ranges

    Using a formula like:

    • =SUM(A1,A2,A3,B1,B2,B3)

    Is equally error prone when inserting or deleting rows within the referenced range for the same reasons. It’s much better to use individual ranges, like:

    • =SUM(A1:A3,B1:B3)

    Which will update when adding or deleting rows.

Comments

Popular posts from this blog

พยางค์

การที่เราเปล่งเสียงออกมาจากลำคอครั้งหนึ่ง ๆ นั้น เราเรียกเสียงที่เปล่งออกมาว่า “พยางค์” แม้ว่าเสียงที่เปล่งออกมาจะมีความหมายหรือไม่มีความหมายก็ตาม เช่น เราเปล่งเสียง “สุ” ถึงจะไม่ รู้ความหมาย หรือไม่รู้เรื่องเราก็เรียกว่า ๑ พยางค์ หากเราเปล่งเสียงออกมาอีกครั้งหนึ่งว่า “กร” จะ เป็น “สุกร” จึงจะมีความหมาย คำว่า “สุกร” ซึ่งเปล่งเสียง ๒ ครั้ง เราก็ถือว่ามี๒ พยางค์ เสียงที่เปล่ง ออกมาครั้งเดียวมีความหมาย เช่น นา หมายถึง ที่ปลูกข้าว เสียงที่เปล่งออกมาว่า “นา” นี้เป็น ๑ พยางค์ ลองดูตัวอย่างต่อไปนี้ ไร่ มี๑ พยางค์ ชาวไร่ มี๒ พยางค์ (ชาว-ไร่) สหกรณ์ มี๓ พยางค์ (สะ-หะ-กอน) โรงพยาบาล มี๔ พยางค์ (โรง-พะ-ยา-บาน) นักศึกษาผู้ใหญ่ มี๕ พยางค์ (นัก-สึก-สา-ผู้-ใหญ่) สหกรณ์การเกษตร มี๖ พยางค์ (สะ-หะ-กอน-การ-กะ-เสด) จากตัวอย่างข้างบนนี้สรุปได้ว่า พยางค์ คือ เสียงที่เปล่งออกมาครั้งหนึ่ง จะมีความหมายหรือไม่มีความหมายก็ตาม ถ้าเปล่ง เสียงออกมา ๑ ครั้ง ก็เรียก ๑ พยางค์ สองครั้งก็เรียก ๒ พยางค์ องค์ประกอบของพยางค์ พยางค์เกิดจากการเปล่งเสียงพยัญชนะ สระ และวรรณยุกต์ออกมาพร้อม ๆ กัน พยางค์ที่มี ความหมายอาจจะเป็นพยา...

How to Download and Install SQL Server

  Pre-Requisites Principally, MS SQL server requires: .Net Framework,1GB of recommended memory, and NTFS system. How to download SQL Server Setup Step 1)  Go to URL :   https://www.microsoft.com/en-in/sql-server/sql-server-downloads Microsoft provides  two specialized free editions  to work on MS SQL server: Developer  – It has all feature which MS SQL server offers but we cannot use it in production. From the learning perspective, is it an ideal candidate to start. Express : This is also a free version but with the limited set of features with no business intelligence applications. We will select the  Developer edition  for installation. Step 2)  Click on  "Download now" We will get set up as  'SQLServer2017-SSEI-Dev.exe'. How to Install SQL Server Step 1)  Double click on  "SQLServer2017-SSEI-Dev.exe".  Below screen will appear with three options: Basic, Custom and Download files. Step 2)  Choose the basic vers...

อักษรควบ

คำควบกล้ำ ( อักษรควบ ) หมายถึง พยัญชนะสองตัวเขียนเรียงกันอยู่ต้นพยางค์ และใช้สระเดียวกัน เวลาอ่านออกเสียงกล้ำเป็นพยางค์เดียวกัน เสียงวรรณยุกต์ของพยางค์นั้นจะผันเป็นไปตามเสียงพยัญชนะตัวหน้า คำควบกล้ำ ( อักษรควบ ) มี 2 ชนิด คือ คำควบแท้ ได้แก่ พยัญชนะ ร ล ว ควบกับพยัญชนะตัวหน้า ประสมสระตัวเดียวกัน เวลาอ่านออกเสียงพยัญชนะทั้งสองตัวพร้อมกัน เช่น พยัญชนะต้นควบกับ ร ได้แก่ ครู เพราะ ครัว กรน ปรวนแปร ขรุขระ พระ ตรง ครั้ง กราบ โปรด ปรักปรำ ครื้นเครง เคร่งครัด ครอบ ปรอย กรอง พยัญชนะต้นควบกับ ล ได้แก่ เปล่า ปลีก คลาน คลุก เคล้า เปลี่ยนแปลง กลบ กลม เพลิดเพลิน เกลี้ยกล่อม เกลียวคลื่น คล่องแคล่ว เกล้า พยัญชนะต้นควบกับ ว ได้แก่ กวาด ขวาน ควาย ขวิด แคว่งคว้าง แขวน ขวนขวาย คว่ำ ควาญ แกว่งไกว ความ แคว้น ขวัญ ควัน คำควบไม่แท้ ได้แก่ พยัญชนะ ร ควบกับพยัญชนะตัวหน้าประสมสระตัวเดียวกัน เวลาอ่านไม่ออกเสียง ร ออกเสียงเฉพาะตัวหน้าหรือมิฉะนั้นก็ออกเสียง เป็นเสียงอื่นไป คำควบไม่แท้ที่ออกเสียงเฉพาะพยัญชนะตัวหน้า ได้แก่พยัญชนะ จ ซ ศ ส ควบกับ ร เช่น จริง ไซร้ เศร้า ศรี ศรัทธา สร้าง เสริม สร้อย สระ สรง สร่าง คำควบไม...