Donate SIGN UP

Next Excel Spreadsheet Question ... Leaving A Cell Blank

Avatar Image
joggerjayne | 13:35 Fri 16th Jan 2015 | Technology
16 Answers
If I put any number at all into Cell B7,

I want Cell H7 to show the word "Purchase"

If I leave B7 empty,

I want H7 to stay empty.

So far, in H7, I've got ...

=IF(B7>0,"Purchase", ,)

Not sure how to finish it off.
Gravatar

Answers

1 to 16 of 16rss feed

Best Answer

No best answer has yet been selected by joggerjayne. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
Just a quick test coming up...

bla bla >bla bla
=IF(B7>0,"Purchase","")
Actually that not quite right. You want it to not be empty, not >0. I'd have to look that up but I'm on lunch.
I think it's more sensible to test the value of cell B7 by comparing it specifically to an empty cell rather than greater than 0 (just in case, magically, you wanted to put a negative number into cell B7), but otherwise OG's solution is correct. To ask Excel to leave the cell empty, one should put in the final part two adjacent speech marks "".

Hence

=IF(B7="","","Purchase")

is my choice.
Question Author
Having anything nice, OG?
=IF(B3>0,"Purchase","")
http://www.techonthenet.com/excel/formulas/isblank.php

TRy

IF ((ISBLANK(CELLNAME)),"","Purchase")

See if that works.
Soup & sunbites
Try this:
in H7 type

IF(ISNUMBER(B7),"Purchase","")

This will return the word "Purchase" in H7 if B7 contains any number (positive, negative or zero) but leave it blank if cell H7 is blank or contains anything other than a number.

Sorry Jane, you need "=" before the formula.
Question Author
Soup. Me too. Not sure what sun bites are.
Question Author
Wow, thanks guys. These all seem to work.
The catch with either of our formulas (although OG's is better syntax) is that if you accidentally put anything at all into cell B7 then it would come out as "Purchase". The only way around that might be to redesign the spreadsheet so that a "no purchase" cell in B7 is not left blank but filled with something like "null", over which there can be less ambiguity, and you could even have a double-if statement, such as:

=IF(B7="null","",IF(B7>0,"Purchase",""))

Which means that if you accidentally typed "Null" then you'd still get a blank cell, as the second If statement forces "Purchase" only if the information in B7 can be interpreted as a number (greater than 0).
NJ's suggestion seems the most elegant.
Which is what my formula avoids, Jim, only without the need for "nested IFs". It will only return "purchase" if B7 contains a number.
Sorry, Jim, I'm one post behind !!!

1 to 16 of 16rss feed

Do you know the answer?

Next Excel Spreadsheet Question ... Leaving A Cell Blank

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.