Forum Discussion
RobertsTrying
Jun 18, 2024Copper Contributor
Excel challenge calculating when a formula leaves a blank cell
Wondering if anyone can make this formula work? I just want to subtract 2 numbers but there are formulas in the reference and resulting cells. The following formula results in a blank answer when the...
- Jun 18, 2024
RobertsTrying
Jun 18, 2024Copper Contributor
Thanks for trying but if one of the cells (p or q) is blank, your formula gives me a #Value! error
because there is a formula in both cells.
because there is a formula in both cells.
SergeiBaklan
Jun 18, 2024Diamond Contributor
I see. So actually you could have empty strings in the cells. Formula can't return blank as value. WE may use
=IF( (P10="")*(Q10=""), "", N(P10)-N(Q10) )
N() applied to any text (includes empty string) returns zero.
- RobertsTryingJun 18, 2024Copper ContributorI learned something new with the N() function. Thanks again Sergei. This is very helpful now and for future reference.
- SergeiBaklanJun 18, 2024Diamond Contributor
RobertsTrying , you are welcome, glad to help
- RobertsTryingJun 18, 2024Copper ContributorThanks so much Sergei. This is so much simpler than the AI suggestion, and it works!!