This may be an easy question. I looked around using Search but didn't see this. Is there a way in Excel 2003, formula or otherwise, to have a formula evaluate the result of another formula?
Specifically, I have one column (we'll say Column
of cells with a formula referencing another column (Column A). This is a simplification of it: IF(A1>0, do stuff, ""), so if the cell in Column A is blank, it won't display anything. The problem is that column A has a formula referencing another spreadsheet using the same IF function, so while it may look blank (and is, as far as this is concerned), it's never actually blank as far as Excel cares (the formula is always there, so it's technically not blank).
Is there a way to do something like: IF(RESULT(A1)>0, do stuff, "")? I tried Value(), but that does nothing. As it is now, the column is showing #VALUE!, where if I delete the formula in Column A, it's blank as I want it. Is what I'm looking for possible?
Posts
IF(AND(A1>0,A1<>""),do stuff,"") works for me in the situation you describe.
=IF(A1="","",do stuff)
In other words, looking for a value of "" will satisfy both the 'pseudo-blank' and 'really blank' conditions. Look for that value, and run your code if the outcome is false. Looking for "" is much more foolproof than looking for >0.
Awesome, that did it. Any idea why ="" evaluates the result of the function while >0 doesn't?
Yeah, Column A is dates, so I don't care if it's less than zero, but I appreciate the suggestion.
Still, is there a way to do what I was originally asking? It may not be necessary here, but there have been other times in the past where it would have been helpful.
CELL()
ISBLANK()
TEXT()
ISNONTEXT()
ISREF()
ISTEXT()
Range().Value property (VBA)
If you want to share some specific examples of other problems you've had, I could maybe give more specific advice. As it is I just can't wrap my head around the underlying problem here. All I can see is that you've hard-coded a "" value into a cell under certain conditions, so you would want to look for that value when referencing it. I can't think of any other situations where simply referencing a cell wouldn't work. I'm sure there are other cases, but I'm not coming up with any off the top of my head and without that context, it's hard to tell exactly what you want Excel to do.
To be honest, I can't remember off the top of my head specific examples. I just remember thinking, "If this were a pointer, this would be much easier."
The more I think about it, though, the more I may be confusing myself. I think Excel usually does reference the result of a function. I think I was just going about this particular problem in the wrong way.
I'll read up on those functions, though, just to expand my knowledge.