Nested IF/ISBLANK statement

smurkin28

New Member
Joined
Sep 20, 2016
Messages
5
Hi guys,

First time poster looking for some help with a formula i am writing.
I am writing a formula that take date away from another to calculate the rest period between shifts

Here is where I am right now:

=IF(ISBLANK(J26),(I27-J25)+TIME(24,0,0),IF(ISBLANK(AND(J25,J26)),(I27-J24)+TIME(48,0,0),IF(ISBLANK(AND(J24,J25,J26)),(I27-J23)+TIME(72,0,0),IF(ISBLANK(I27),0,(I27-J26)))))


But the issue I am having is when J25,J26 are blank because there is a conflict where it also sees just J26 as blank.
Is the there a way to weight the true statementsso if one is true any others are ignored.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I think your "AND" IFs should take precedent over your individual IFs. You need to put the ANDs first

Try
=IF(ISBLANK(AND(J24,J25,J26)),(I27-J23)+TIME(72,0,0),IF(ISBLANK(AND(J25,J26)),(I27-J24)+TIME(48,0,0),IF(ISBLANK(J26),(I27-J25)+TIME(24,0,0),IF(ISBLANK(I27),0,(I27-J26)))))
 
Upvote 0
I think your "AND" IFs should take precedent over your individual IFs. You need to put the ANDs first

Try
=IF(ISBLANK(AND(J24,J25,J26)),(I27-J23)+TIME(72,0,0),IF(ISBLANK(AND(J25,J26)),(I27-J24)+TIME(48,0,0),IF(ISBLANK(J26),(I27-J25)+TIME(24,0,0),IF(ISBLANK(I27),0,(I27-J26)))))



Thanks for input in coming to a solution,

this is something i have also tried with no luck
it still comes with the wrong value for example. when the value should be 3.63 i am getting numbers like this 42692.0416666088 because the conflict of more than one blank statement being true
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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