#### meppwc

##### Well-known Member
I have a formula that works fine now, but I want to add an additional condition.

The existing formula (below) resides in cell P2. It looks to see if cell E2 is blank. If E2 is blank then P2 is blank, if E2 is not blank, then P2 is populated with the result of N2-M2. Note, the values in N2 and M2 are dates using the format of 1/1/2014.

=IF(E2="","",N2-M2)

I want add another condition to this formula. Here is the overall logic I need.

If E2 is blank, then return blank
If E2 is not blank and J2 is blank, then perform N2-M2
If E2 is not blank and J2 is not blank, then perform M2-J2 (note that J2 is also a date in the format of 1/1/2014)

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
=IF(E2="","",IF(AND(E2<>"",J2=""),N2-M2,IF(AND(E2<>"",J2<>""),M2-N2,"Other")))

Thanks so much Joe

Replies
8
Views
224
Replies
3
Views
159
Replies
5
Views
517
Replies
2
Views
314
Replies
2
Views
140

1,207,171
Messages
6,076,916
Members
446,241
Latest member
Nhacai888b

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