help with formula to display 13 or 15

LearningEX

Board Regular
Joined
Mar 13, 2015
Messages
206
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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
6,167
Office Version
  1. 365
Platform
  1. MacOS
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:

Phuoc

Well-known Member
Joined
Apr 29, 2016
Messages
693
Office Version
  1. 2016
Or try:

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

Forum statistics

Threads
1,176,197
Messages
5,901,857
Members
434,924
Latest member
husamco

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
Top