Help with count function in Excel 2007?


hi there, im trying to use the count function in excel but for some reason i am not getting the write answer. I have a column labeled "expenses" and i want to count the number of types of expenses listed. for example, there are 6 different expenses listed such as rent, insurance, and etc. but when i try the count function, it keeps telling me 0. am i doing something wrong? thanks for any help! p.s. the formula looks like this: =COUNT(A6:A11)

Written by Kh in Software


Better Answer

you are using the wrong function. Excel has several counting functions, it seems you need to use the COUNTA function.

HOW TO COUNT IN EXCEL:
• COUNT this function will count cells that contain numbers. Syntax: =count(data)
• COUNTA this function will count cells with data, cells that are not empty, Syntax: =counta(data)
Hint: To count only text use =counta(data) – count(data)
• COUNTBLANK this function will count cells that are empty. Syntax: =countblank(data)
• COUNTIF this function will count cells that meets certain criteria. Syntax: =countif(data, criteria )
• COUNTIFS for each data range counts the cells that meets the given criteria Syntax: =countifs(data1, criteria1, data2, criteria2 ) (only for excel 2007/2010)

Example: You have this data from B1:B6 (Notice that B2 is a empty cell)
2

text
3
text
76

Then using the excel counting functions:
= COUNT(B2:B6) will return the value 3
= COUNTA(B2:B6) will return the value 5
= COUNTBLANK(B2:B6) will return the value 1
= COUNTIF(B2:B6,"text") will return the value 2

Use the function that best suites you.

Written by Gospieler


Other Answers

The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers.

I think from your description what you need is
=COUNTIF(A6:A11,"rent") repeat for similar formula for other 5 types of expenses

HTH

Written by Denn

Microsoft provides several examples of array functions here, that should match with what you are describing

http://office.microsoft.com/en-us/excel-help/count-occurrences-of-values-or-unique-values-in-a-data-range-HP003056118.aspx

just be sure to press CTRL+SHIFT+ENTER when you finish the formula

hope that helps

Written by C Masters

you are using the wrong function. Excel has several counting functions, it seems you need to use the COUNTA function.

HOW TO COUNT IN EXCEL:
• COUNT this function will count cells that contain numbers. Syntax: =count(data)
• COUNTA this function will count cells with data, cells that are not empty, Syntax: =counta(data)
Hint: To count only text use =counta(data) – count(data)
• COUNTBLANK this function will count cells that are empty. Syntax: =countblank(data)
• COUNTIF this function will count cells that meets certain criteria. Syntax: =countif(data, criteria )
• COUNTIFS for each data range counts the cells that meets the given criteria Syntax: =countifs(data1, criteria1, data2, criteria2 ) (only for excel 2007/2010)

Example: You have this data from B1:B6 (Notice that B2 is a empty cell)
2

text
3
text
76

Then using the excel counting functions:
= COUNT(B2:B6) will return the value 3
= COUNTA(B2:B6) will return the value 5
= COUNTBLANK(B2:B6) will return the value 1
= COUNTIF(B2:B6,"text") will return the value 2

Use the function that best suites you.

Written by Gospieler