Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Rich" wrote:
I'm using the following formula in cell c1: =if(isblank(a1),"",a1) to "copy" the a1 cell value to cell c1 without displaying a zero if a1 is blank. You probably want to use the following formula: =IF(A1="","",A1) Why does CountBlank consider a cell with the value of "" as blank, but IsBlank does not? Unix developers have a saying: "Never ask ``why?``." It is what it is. Your confusion is understandable because of the ambiguous meaning of the word "blank" in the vernacular as well as it is used in Excel. The simple answer to your question ("why?") is: don't get hung up on the word "blank"; always RTFM. The Help page for IS functions says that ISBLANK returns TRUE if its argument "refers to an empty cell". I don't know if "empty cell" is ever formally defined; it means: a cell that has no constant and no formula. So by definition, a formula cannot return an "empty cell"; it can only return a value that __appears__ blank. In contrast, the Help page for COUNTBLANK says that in addition to counting "empty cells", ``cells with formulas that return "" (empty text) are also counted``. Why? Because that's the way it is. (IMHO, "" should be call a null string or null text, not "empty text".) I found this apparent discrepany in results because I actually want to use CountA(c1:c4) to count non-blank cells, but it's count cells with a value of "" as a non-blank cell. [....] Is there a better way to copy a blank value from a1 to c1? I'm confused. On the one hand, you say you want to __count__ "non-blank" cells (i.e. cells that do not appear blank). On the other hand, you ask for a better way to __copy__ a "blank value". Those two very different actions with very different solutions. As to the latter (copy), see the formula above. As to the former (counting), consider: =SUMPRODUCT(--(C1:C4<"")) Note: A cell containing a "blank string" -- that is, text composed of one or more spaces, which is what you enter when you press the Space bar -- is counted as non-blank, even though it also appears blank. If you also want to exclude such cells from your count of "non-blank" cells, consider: =SUMPRODUCT(--(TRIM(C1:C4)<"")) ----- original message ----- "Rich" wrote in message ... I'm using the following formula in cell c1: =if(isblank(a1),"",a1) to "copy" the a1 cell value to cell c1 without displaying a zero if a1 is blank. The trouble I'm having is if cell a1 is blank, thus making the value of c1 = "".... =isblank(c1) returns false (the cell is not blank), but... =countblank(c1) returns 1 (the cell is blank) Why does CountBlank consider a cell with the value of "" as blank, but IsBlank does not?? I found this apparent discrepany in results because I actually want to use CountA(c1:c4) to count non-blank cells, but it's count cells with a value of "" as a non-blank cell. I know I can "work around" this by using 4-countblank(c1:c4) to find the number of non-blank cells, but I like the direct route better. Is there a better way to copy a blank value from a1 to c1?? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conflicting Calculations | Excel Discussion (Misc queries) | |||
Conflicting vlookups | Excel Worksheet Functions | |||
Conflicting VBA Coding | Excel Programming | |||
Conflicting results in formulas? | Excel Worksheet Functions | |||
Conflicting VBA's | Excel Programming |