IF Function Excel ( Time value changes )

shiraz50

New Member
Joined
Jan 16, 2023
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi .
I need to do a if functions that will show the following .I added in some inputs manually. Please help.

If column N is between time range of 4:00 to 6:07 minutes then add column N time in Q
If column N is between time range of 6:08 to 7:34 minutes then add column N time in R
If column N is > 7:34 minutes then add column N time in S

1702368671921.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
=IF(N2>TIMEVALUE("00:07:34"),N2+S2,IF(N2>TIMEVALUE("00:06:07"),N2+R2,IF(N2>TIMEVALUE("00:04:00"),N2+Q2,"")))


Book2
NOPQRST
1
200:03:001:002:003:00 
300:03:301:002:003:00 
400:04:001:002:003:00 
500:04:301:002:003:0001:04:30
600:05:001:002:003:0001:05:00
700:05:301:002:003:0001:05:30
800:06:001:002:003:0001:06:00
900:06:301:002:003:0002:06:30
1000:07:001:002:003:0002:07:00
1100:07:301:002:003:0002:07:30
1200:08:001:002:003:0003:08:00
Sheet1
Cell Formulas
RangeFormula
T2T2=IF(N2>TIMEVALUE("00:07:34"),N2+S2,IF(N2>TIMEVALUE("00:06:07"),N2+R2,IF(N2>TIMEVALUE("00:04:00"),N2+Q2,"")))
T3:T12T3=IF(N3>TIMEVALUE("0:7:34"),N3+S3,IF(N3>TIMEVALUE("0:6:07"),N3+R3,IF(N3>TIMEVALUE("0:4:00"),N3+Q3,"")))
 
Upvote 0
If you can put those time parameters somewhere on your sheet (I put them in row 4 - shift them to suit) then does this work for you?
Book1
NOPQRS
404:0006:0707:34
504:3904:39  
607:06 07:06 
706:31 06:31 
807:35  07:35
907:20 07:20 
Sheet1
Cell Formulas
RangeFormula
Q5:Q9Q5=IF(AND($N5>=Q$4,$N5<=R$4),$N5,"")
R5:R9R5=IF(AND($N5>R$4,$N5<=S$4),$N5,"")
S5:S9S5=IF($N5>S$4,$N5,"")
 
Upvote 0
Solution
Like This ?


Range Q1
Excel Formula:
=IF(AND(TEXT(N1,"hh:mm")>TEXT("04:00","hh:mm"),TEXT(N1,"hh:mm")<TEXT("06:07","hh:mm")),TEXT(N1,"hh:mm"),"")

Range R1
Excel Formula:
=IF(AND(TEXT(N1,"hh:mm")>TEXT("06:08","hh:mm"),TEXT(N1,"hh:mm")<TEXT("07:34","hh:mm")),TEXT(N1,"hh:mm"),"")

Range S1
Excel Formula:
=IF(TEXT(N1,"hh:mm")>TEXT("07:34","hh:mm"),TEXT(N1,"hh:mm"),"")



1702370830571.png


*I hope this helps your problem, If there’s any unclear information please let me know :)
 
Upvote 0
Like This ?


Range Q1
Excel Formula:
=IF(AND(TEXT(N1,"hh:mm")>TEXT("04:00","hh:mm"),TEXT(N1,"hh:mm")<TEXT("06:07","hh:mm")),TEXT(N1,"hh:mm"),"")

Range R1
Excel Formula:
=IF(AND(TEXT(N1,"hh:mm")>TEXT("06:08","hh:mm"),TEXT(N1,"hh:mm")<TEXT("07:34","hh:mm")),TEXT(N1,"hh:mm"),"")

Range S1
Excel Formula:
=IF(TEXT(N1,"hh:mm")>TEXT("07:34","hh:mm"),TEXT(N1,"hh:mm"),"")



View attachment 103371

*I hope this helps your problem, If there’s any unclear information please let me know :)
Thanks for the prompt response . U guys are legends
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,234
Members
449,092
Latest member
SCleaveland

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