![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 8
|
Hello all, I hope this question makes sense. I have a column that is filled with numbers coming from an IF statement. The IF statement either returns a value or "". I want to count the number of cells that have values, and not the "", but I keep getting "" returned as a value. Do any of you gurus know how to count just the cells with numbers in them and/or turn the "" into something else that is not counted in the COUNT formula??? THANKS!! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Why not use the COUNTIF function?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
Hi Ant
You can use the counta() function this function count only cells with values,text,or logical values (true or false) Hope that helps
__________________
Best Regards Andreas
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
|
something seems fishy here. You only want to count the numbers and by default count only counts numbers. Are you sure you're populated with a "" and your range is okay???
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,315
|
COUNT ignores "" even if generated by a formula and cannot return "" as result. |
|
|
|
|
|
#6 |
|
New Member
Join Date: May 2002
Posts: 8
|
I've been looking for guys like you!!
Thanks for the suggestions. I believe my range is correct. I think Count.if sounds right, but I must be employing it wrong since it is a new function for me. Basically, I am trying to get a total count; I imagine the process would go: 1) Check the value in the cell. 2) If the value is "", dont count it, otherwise, count it and move to the next cell. 3) At the end of say 25 cells, I should have the total of all the cells with actual values. Is this something for VBA or can the count.if statement check one cell, store its value, then move to the next... Thanks again! |
|
|
|
|
|
#7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,315
|
Quote:
You can see the formula of cells only click each above hyperlinks The above image was automatically written by excel VBA. If you want this code, click here and I'll email the file to you. This is intended to convince you that COUNT really ignores blanks. A2 and A5 are blanks, generated using an IF formula. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#8 |
|
New Member
Join Date: May 2002
Posts: 8
|
I think I see my problem now.
My if statement: =SE(H14="sales";U14;"") is returning - in the cell for "". Is this a formatting problem?? Thanks again. |
|
|
|
|
|
#9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
my example works
You can see the value of cells only click each above hyperlinks
__________________
Best Regards Andreas
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#10 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,315
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|