# Help with multiple if functions in one cell

#### amlagu

##### New Member
Hi. I was hoping you could help me. This question has multiple layers. I have a spreadsheet where if a date appears in one cell (L6) then I want to subtract I6 from H6, but if no date appears I want to just display H6 value in Q6.

I have used this formula and it works: =IF(ISBLANK(L6), H6, H6-I6)

But if H6 has a value, but N6 doesn't then I want to H6-I6-M6.

This formula also works: =IF(ISBLANK(N6),H6-I6,H6-I6-M6)

But I actually want to merge the formulas together, so if both cells are blank, then Q6 shows the H6 value, but if L6 has a value but N6 doesn't then I want Q6 to subtract I6 from H6, but if both L6 and N6 have a value, then in Q6 I want the answer to the equation H6-I6-M6.

Hope that makes sense.

Many thanks

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

#### WarPigl3t

##### Well-known Member
=if(l6="", h6, if(n6<>"", h6-i6-m6, h6-i6))

#### amlagu

##### New Member
Thank you so much. Would you also be able to please help with adding one more if function to the cell, if L6 and N6 have a value but P6 doesn't then I want Q6 to answer the equation H6-I6-M6 but if L6, N6 and P6 all have a value, then in Q6 I want the answer to the equation H6-I6-M6-O6. I am missing something when I tried to work it out myself. Thanks again.

#### C Moore

##### Well-known Member
Try this, if not exactly what you need should get you on the road to solving it.

=IF(AND(ISBLANK(L6),ISBLANK(N6)),H6,IF(AND(NOT(ISBLANK(L6)),ISBLANK(N6)),H6-I6,H6-I6-M6))

Replies
4
Views
133
Replies
9
Views
194
Replies
4
Views
376
Replies
5
Views
829
Replies
8
Views
147

1,191,032
Messages
5,984,247
Members
439,879
Latest member
KingGoulash

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