If statement - blank cells

Shukis7

New Member
Joined
Dec 14, 2021
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm trying to use the if statement to check for blank cells and then do something if the cell is blank, and if not then leave the cell as is.

Below is the formula I'm currently using.

=IF(AP2="",IF(ISNUMBER(SEARCH(Sheet1!$B$2,BF2)),"Apartment",IF(ISNUMBER(SEARCH(Sheet1!$B$3,BF2)),"House",IF(ISNUMBER(SEARCH(Sheet1!$B$4,BF2)),"Office",IF(ISNUMBER(SEARCH(Sheet1!$B$5,BF2)),"Shop",IF(ISNUMBER(SEARCH(Sheet1!$B$6,BF2)),"Shop"," "))))),AP2)

Note that without the first part IF(AP2="" the formula is working perfectly. However, when I want it to apply only on blank cells it doesn't seem to work and for every cell it returns a zero.

I would appreciate any help.

Thank you!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi, try like this instead.

=IF(AP2="",IF(ISNUMBER(SEARCH(Sheet1!$B$2,BF2)),"Apartment",IF(ISNUMBER(SEARCH(Sheet1!$B$3,BF2)),"House",IF(ISNUMBER(SEARCH(Sheet1!$B$4,BF2)),"Office",IF(ISNUMBER(SEARCH(Sheet1!$B$5,BF2)),"Shop",IF(ISNUMBER(SEARCH(Sheet1!$B$6,BF2)),"Shop"," "))))),"")
 
Upvote 0
Hi thanks for the reply, it's still giving me zero for all cells for some reason.
 
Upvote 0
Then maybe the cell is not really blank - what does this formula return?
Excel Formula:
=AP2=""
when applied to one the seemingly blank cells.
 
Upvote 0
It's giving me 0. Does that mean the cells are not really blank? I've deleted everything in those cells, should I do like clear all?
 
Upvote 0
My bad, it's returning TRUE so the cells are indeed blank. The problem is that I'm referring to the own cell. I'm trying to apply the formula to AP2 and AP2 is one of the variables in the formula.
 
Upvote 0
I'm trying to apply the formula to AP2 and AP2 is one of the variables in the formula.

You can't do that as it's circular.

But it doesn't make any sense - if the formula you have already returns a blank, why are you trying to wrap it in another if() statement to say return a blank when it has already returned a blank??
 
Upvote 0
So basically there are two columns that I want the isnumber(search) formula to look into. The first is BH so I did that and worked. Then I wanted to look into the BF columns, but only for the cells that remained blank after the first formula. But know I understand that this is not possible, so should I combine both in one big formula? Thanks for your time btw.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top