help with formula to display 13 or 15

LearningEX

Board Regular
Joined
Mar 13, 2015
Messages
208
good morning all, this probably going to be really simple for someone, ive made a mistake in my formula and cant get it to display either a 13 or 15, if my working time is less than 13 hours worked then i need a 13 to be displayed, if greater than 13.25 (13 hours 15 min) then i need 15 to be displayed.

VBA Code:
=IFERROR(IF(C7="","",IF(C7<13,13,IF(C7>13,15))),"")
Capturetime.JPG
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
this is similar to this question
just different times in other post 9 & 11

you also need to use time ()
13 is not a time value

=IFERROR(IF(C7="","",IF(C7<TIME(13,0,0),TIME(13,0,0),IF(C7>TIME(13,15,0),TIME(15,0,0),C7))),"")
 
Last edited:
Upvote 0
Or try:

=IFERROR(IF(C7="","",IF(C7>TIME(13,15,0),TIME(15,0,0),TIME(13,0,0))),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,215,590
Messages
6,125,698
Members
449,250
Latest member
azur3

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