# Multiple If's, 3 Criteria's

#### horsey

##### New Member
I wanted to do a multiple if statement, where if cell B1 contains within the phrase "report", then for cell C1 to say "report". If B1 contains blank, for the C1 cell to default to say whatever value is in the previous cell. And the 3rd criteria is if the cell B1 doesn't contain "report" or is not blank to say whatever is in cell A1 into C1. I hope I didn't lose anyone through the verbage ramblings.

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the board,
This is actually a very straight forward problem, except what do you mean with "previous cell"?

JPM

You would want something like
=IF(ISBLANK(B1),"previous cell value",CHOOSE(1+ISNUMBER(SEARCH("report",B1)),A1,B1))

where the question is on previous cell value. If you mean, if b1 is blank, leave whatever was in cell c1 the same, you will need code over formula (unless the c1 when can be derived from other cells)

The column C is suppose to change as seen in the screen shot. Many thanks to the board.

I think I got it now:

=IF(ISBLANK(B2),E1,CHOOSE(1+ISNUMBER(SEARCH("report",B2)),A2,"report"))

I skipped the first cell because I needed the resulting formula cell to read data from the previous if needed.

Thanks you guys!

Actually IML's formula has a little hickup in the case B1 has i.e. the word "Expense Report" if will show everything that is in B1, not just the word "report".

You can make this minor adjustment:
=IF(ISBLANK(B1),"previous cell value",IF(ISNUMBER(SEARCH("report",B1))=TRUE,"report",A1))

JPM

Did not see your latest response.

Replies
7
Views
265
Replies
10
Views
562
Replies
8
Views
542
Replies
7
Views
602
Replies
0
Views
347

1,219,935
Messages
6,151,065
Members
451,006
Latest member
dhinze84

### 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.

### Which adblocker are you using?

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

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