Nested If issue

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,077
Hello all,

I have this formula that doesn't seem to be doing what I want:

Code:
=IF(C12>=KDS!D6,KDS!D6-C12,IF(C12<=KDS!D4,((KDS!D4-C12)*2)+KDS!D5-KDS!D4,IF(C12<=KDS!D5,KDS!D5-C12,0)))

C12 has a value of 3:51.
D4 is 3:52
D5 is 4:04
D6 is 4:14

What the formula is supposed to do is if C12 is lower than D4, my result should take the difference between the 2 multiplied by 2 plus the difference between D4 & D5 (should be 14)
If C12 is Higher than D4 but lower than D5 it should be the difference.
And if C12 is higher than D6 the difference (negative) would be displayed, anything else would be 0.

Any help would be wonderful!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi

Does this work for you.

=IF(C12 < D4,D5-D4+(D4-C12)*2,IF(AND(C12 > D4,C12 < D5),D5-D4,IF(C12 > D6,"NEGATIVE","")))
<d4,d5-d4+(d4-c12)*2,if(and(c12><d5),d5-d4,if(c12>

you will need to add your sheet refrences where required.

dave</d5),d5-d4,if(c12></d4,d5-d4+(d4-c12)*2,if(and(c12>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,477
Messages
6,130,879
Members
449,603
Latest member
dizze90

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