Using IF function with times/durations

yahozna

New Member
Joined
Mar 28, 2011
Messages
12
I'm doing a spreadsheet for a school sportsday - event times are recorded as mm:ss.00

I would like to be able to highlight if a school record is acheived in a seperate cell with the words "school record". I can't work out how to do a formula based on for example if cell B4 duration is less than 00:21.25 then "school record"
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I've tried putting the school record in a seperate cell (for example E4) but using IF B4<E4 doesn't seem to work.
I thought that this must be because B4 is a duration/time rather than a number.
 
Upvote 0
I really need minutes, seconds, tenths/hundreths rather than hour, minute, seconds. Is this possible?
 
Upvote 0
If you have the record time in E4 then this works for me

=IF(B4< E4,"School record","")

although that will also show "School record" if B4 is blank so you might want to avoid that by modifying as follows:

=IF(B4="","",IF(B4< E4,"School record",""))
 
Upvote 0
If you have the record time in E4 then this works for me

=IF(B4< E4,"School record","")

although that will also show "School record" if B4 is blank so you might want to avoid that by modifying as follows:

=IF(B4="","",IF(B4< E4,"School record",""))

Thanks that works fine!! Now how could I check a range B4:B11 against the time in E4 (as there are 8 competitors in the event)

Thanks so much for your help - as you can see I'm a bit of a novice in Excel!
 
Upvote 0
I assume you are putting the formula in row 4 then copying down so if you put a $ into E$4 that "fixes" the reference, e.g. in C4 copied down

=IF(B4="","",IF(B4< E$4,"School record",""))

Of course if more than one competitor beats the existing record that will show them all as "School record" so if you only want the winner(s) then change to

=IF(B4="","",IF(AND(B4< E$4,B4=MIN(B$4:B$11)),"School record",""))
 
Upvote 0
I assume you are putting the formula in row 4 then copying down so if you put a $ into E$4 that "fixes" the reference, e.g. in C4 copied down

=IF(B4="","",IF(B4< E$4,"School record",""))

Of course if more than one competitor beats the existing record that will show them all as "School record" so if you only want the winner(s) then change to

=IF(B4="","",IF(AND(B4< E$4,B4=MIN(B$4:B$11)),"School record",""))

I actually wanted to put the formula in just 1 cell but referencing the 8 competitors times. I know that this is probably overcomplicating things, but if its possible I'd love to know how.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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