Nested IF gone wrong

Tomkat

New Member
Joined
Mar 27, 2009
Messages
20
If anyone can help me with this it would be greatly appreciated. I am using the following formula to determine if an employee has worked their required hours for the month to show "Nil", if they have worked less than one extra day (7hrs) "Hours", or if they have worked more than an extra 7 hours "Days". It is working fine except that I have one person that has worked their exact hours but it shows "Days" instead of Nil. I figure this is because it is set up in custom hours [h]:mm but I can't work out how to correct this. Have tried entering 0:00 in my formula.

=IF(c28=0,"Nil",IF(C28>7,"Days",IF(C28<7,"Hours")))

Thanks in advance.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
If a value of 7 in C28 should give you "Nil", try this:

=IF(OR(c28=0,c28=7),"Nil",IF(C28>7,"Days",IF(C28<7,"Hours")))

Denis
 
Upvote 0
What is in C28? Are you sure it contaoins the value 7? If you are getting a result from other calculations (especially time calculations) the chances are you have a value with a small decimal component.
 
Upvote 0
C28 has 0.0. This is part of a timesheet summary so the hours have been set up as custom [h]:mm. I have tried converting this to another format but still cannot get it to work.
 
Upvote 0
If you have tried the suggestion posted by Sydneygeek then C28 cannot contain exactly zero.
Try to format C28 as a regular numeric format style with several decimal places and I think you will find it does not contain zero. The solution might be to use ROUND function in your IF formula. Something like below, but you must change the rounding factor to what is appropriate for your work - I put in "3" as a starting point.
=IF(OR(Round(c28,3)=0,Round(c28,3)=7),"Nil",IF(C28>7,"Days",IF(C28<7,"Hours")))
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

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