

Now let us say that C1:C6 contains a list of weights of these items, and we wish to know the total weight for all big red items. In fact, because TRUE and FALSE evaluate as 1 and 0, we do not need the AND function - in D1 we can simply write =(A1="red")*(B1="big"), and copy/paste down to D2:D6. So entering =SUM(D1:D6) will simply sum those 1s and 0s, and give us the count of items that are both red AND big.

In numerical calculations, TRUE is treated as 1, and FALSE is treated as 0. Copy and paste this formula to D2:D6 and we have a range of cells which are TRUE if the conditions are met and FALSE otherwise. Alternatively, we can enter in cell D1 the formula =AND(A1="red" B1="big"), which returns TRUE if cell A1 is red AND cell B1 is big and FALSE otherwise. For example, if A1:A6 contains a list of colours and B1:B6 a list of sizes, then we can enter in cell D1 the formula =(A1="red"), which returns TRUE or FALSE depending if cell A1 is red or not. One simple method to count or sum using multiple conditions is to enter those conditions in a new row or column. For example, DCOUNT(A1:C5 0 E6:F7) counts the number of rows of A1:C5 for which the multiple conditions specified in E6:F7 are all true. For example SUMIF(A1:A4 "=red" B1:B4) sums the values in B1:B4 that correspond to “ red” entries in A1:A4.ĭSUM function perform similarly to COUNT, COUNTA and SUM, except that the cells to be counted or summed are chosen according to a table of conditions. The SUMIF function sums those items that meet a single condition. For example COUNTIF(A1:A4 ">4") counts the cells in A1:A4 that are greater than 4. The COUNTIF function counts those items that meet a single condition. The SUBTOTAL function returns COUNT, COUNTA or SUM results for filtered data, that is data in cells chosen by a filter.
#Openoffice sum column how to
See later for how to use it as a conditional function. The SUM function sums all the numbers in the specified cells. The COUNTBLANK function counts the number of empty (blank) cells. The COUNTA function counts the number of cells which contain anything (text, numbers, errors, logical values, formulas). The COUNT function counts the number of cells which contain numbers and will ignore any others. This is a review of various ways to count and sum the contents of cells conditionally, depending on the result of some test. 1.21 Tips and Tricks: Summing Matching Items in a Separate ListĬonditional Counting and Summation in Calc.1.20 Tips and Tricks: Summing Items With Certain Formatting.1.19 Tips and Tricks: Summing Every nth Row.

1.18 Tips and Tricks: Counting How Many Odd Numbers.1.17 Tips and Tricks: Summing More Than One Column.1.16 Tips and Tricks: Summing Matching Blank, etc.1.15 Tips and Tricks: Summing the Largest/Smallest Items.1.14 Tips and Tricks: Items Between Two Dates.1.13 Tips and Tricks: Checking Settings.1 Conditional Counting and Summation in Calc.
