Time and If Functions / Conditional Formatting

Harbor1704

New Member
Joined
Feb 11, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have a report that I pull showing the time that files are completed. I am trying to do an IF function where if a time is over a certain amount it would show how many days the file is overdue and then if it is on time or late. I am having no luck figuring out the formula and I think it is partly because the report does not format the production time. It should show like below, I have also included the ranges and a mini sheet sampling to show what I am working with:

1660314123738.png



There are specific Ranges for each.

1 Day = 0 to 24 Hours (0 Mins to 1 Day) On Time

2 Days
= 24+ Hrs to 52 Hrs (1 day 1min to 2 days 4 hours) On Time

3 – 4 Days =
52+ Hrs to 96 Hrs. (2 days 4 hours 1 min to 4 days) Late

Over 4 Days =
96+ Hrs (4 days 1 min. +) Late


AGENT TURN AROUND.xls
FGHI
1Production TimeMonthRangeOn Time/Late
2 4 hour(s) 6 min.Aug
3 3 hour(s) 7 min.Aug
4 2 hour(s) 58 min.Aug
51 day(s) 2 hour(s) 18 min.Aug
6 6 hour(s) 6 min.Aug
7 1 hour(s) Aug
8 2 hour(s) 41 min.Aug
91 day(s) 2 hour(s) 2 min.Aug
10 1 hour(s) 5 min.Aug
11 2 hour(s) 6 min.Aug
12 1 hour(s) 19 min.Aug
13 2 hour(s) 14 min.Aug
146 day(s) 2 hour(s) 20 min.Aug
15 3 hour(s) 37 min.Aug
16 1 hour(s) 13 min.Aug
17 1 hour(s) 20 min.Aug
181 day(s) 5 hour(s) 58 min.Aug
191 day(s) 1 hour(s) 32 min.Aug
20 2 hour(s) 52 min.Aug
21 1 hour(s) 53 min.Aug
22 1 hour(s) 31 min.Aug
23 3 hour(s) 26 min.Aug
241 day(s) 6 hour(s) 8 min.Aug
Sheet1
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I have a report that I pull showing the time that files are completed. I am trying to do an IF function where if a time is over a certain amount it would show how many days the file is overdue and then if it is on time or late. I am having no luck figuring out the formula and I think it is partly because the report does not format the production time. It should show like below, I have also included the ranges and a mini sheet sampling to show what I am working with:

View attachment 71457


There are specific Ranges for each.

1 Day = 0 to 24 Hours (0 Mins to 1 Day) On Time

2 Days
= 24+ Hrs to 52 Hrs (1 day 1min to 2 days 4 hours) On Time

3 – 4 Days =
52+ Hrs to 96 Hrs. (2 days 4 hours 1 min to 4 days) Late

Over 4 Days =
96+ Hrs (4 days 1 min. +) Late


AGENT TURN AROUND.xls
FGHI
1Production TimeMonthRangeOn Time/Late
2 4 hour(s) 6 min.Aug
3 3 hour(s) 7 min.Aug
4 2 hour(s) 58 min.Aug
51 day(s) 2 hour(s) 18 min.Aug
6 6 hour(s) 6 min.Aug
7 1 hour(s) Aug
8 2 hour(s) 41 min.Aug
91 day(s) 2 hour(s) 2 min.Aug
10 1 hour(s) 5 min.Aug
11 2 hour(s) 6 min.Aug
12 1 hour(s) 19 min.Aug
13 2 hour(s) 14 min.Aug
146 day(s) 2 hour(s) 20 min.Aug
15 3 hour(s) 37 min.Aug
16 1 hour(s) 13 min.Aug
17 1 hour(s) 20 min.Aug
181 day(s) 5 hour(s) 58 min.Aug
191 day(s) 1 hour(s) 32 min.Aug
20 2 hour(s) 52 min.Aug
21 1 hour(s) 53 min.Aug
22 1 hour(s) 31 min.Aug
23 3 hour(s) 26 min.Aug
241 day(s) 6 hour(s) 8 min.Aug
Sheet1

I have a report that I pull showing the time that files are completed. I am trying to do an IF function where if a time is over a certain amount it would show how many days the file is overdue and then if it is on time or late. I am having no luck figuring out the formula and I think it is partly because the report does not format the production time. It should show like below, I have also included the ranges and a mini sheet sampling to show what I am working with:

View attachment 71457


There are specific Ranges for each.

1 Day = 0 to 24 Hours (0 Mins to 1 Day) On Time

2 Days
= 24+ Hrs to 52 Hrs (1 day 1min to 2 days 4 hours) On Time

3 – 4 Days =
52+ Hrs to 96 Hrs. (2 days 4 hours 1 min to 4 days) Late

Over 4 Days =
96+ Hrs (4 days 1 min. +) Late


AGENT TURN AROUND.xls
FGHI
1Production TimeMonthRangeOn Time/Late
2 4 hour(s) 6 min.Aug
3 3 hour(s) 7 min.Aug
4 2 hour(s) 58 min.Aug
51 day(s) 2 hour(s) 18 min.Aug
6 6 hour(s) 6 min.Aug
7 1 hour(s) Aug
8 2 hour(s) 41 min.Aug
91 day(s) 2 hour(s) 2 min.Aug
10 1 hour(s) 5 min.Aug
11 2 hour(s) 6 min.Aug
12 1 hour(s) 19 min.Aug
13 2 hour(s) 14 min.Aug
146 day(s) 2 hour(s) 20 min.Aug
15 3 hour(s) 37 min.Aug
16 1 hour(s) 13 min.Aug
17 1 hour(s) 20 min.Aug
181 day(s) 5 hour(s) 58 min.Aug
191 day(s) 1 hour(s) 32 min.Aug
20 2 hour(s) 52 min.Aug
21 1 hour(s) 53 min.Aug
22 1 hour(s) 31 min.Aug
23 3 hour(s) 26 min.Aug
241 day(s) 6 hour(s) 8 min.Aug
Sheet1

I have a report that I pull showing the time that files are completed. I am trying to do an IF function where if a time is over a certain amount it would show how many days the file is overdue and then if it is on time or late. I am having no luck figuring out the formula and I think it is partly because the report does not format the production time. It should show like below, I have also included the ranges and a mini sheet sampling to show what I am working with:

View attachment 71457


There are specific Ranges for each.

1 Day = 0 to 24 Hours (0 Mins to 1 Day) On Time

2 Days
= 24+ Hrs to 52 Hrs (1 day 1min to 2 days 4 hours) On Time

3 – 4 Days =
52+ Hrs to 96 Hrs. (2 days 4 hours 1 min to 4 days) Late

Over 4 Days =
96+ Hrs (4 days 1 min. +) Late


AGENT TURN AROUND.xls
FGHI
1Production TimeMonthRangeOn Time/Late
2 4 hour(s) 6 min.Aug
3 3 hour(s) 7 min.Aug
4 2 hour(s) 58 min.Aug
51 day(s) 2 hour(s) 18 min.Aug
6 6 hour(s) 6 min.Aug
7 1 hour(s) Aug
8 2 hour(s) 41 min.Aug
91 day(s) 2 hour(s) 2 min.Aug
10 1 hour(s) 5 min.Aug
11 2 hour(s) 6 min.Aug
12 1 hour(s) 19 min.Aug
13 2 hour(s) 14 min.Aug
146 day(s) 2 hour(s) 20 min.Aug
15 3 hour(s) 37 min.Aug
16 1 hour(s) 13 min.Aug
17 1 hour(s) 20 min.Aug
181 day(s) 5 hour(s) 58 min.Aug
191 day(s) 1 hour(s) 32 min.Aug
20 2 hour(s) 52 min.Aug
21 1 hour(s) 53 min.Aug
22 1 hour(s) 31 min.Aug
23 3 hour(s) 26 min.Aug
241 day(s) 6 hour(s) 8 min.Aug
Sheet1

You have the in the next table a formula, to convert the string to time format
Book1
AB
1Production Time
2 4 hours 6 minutes0:04:06
3 3 hour(s) 7 min.0:03:07
4 2 hour(s) 58 min.0:02:58
51 day(s) 2 hour(s) 18 min.1:02:18
6 6 hour(s) 6 min.0:06:06
7 1 hour(s) 0:01:00
8 2 hour(s) 41 min.0:02:41
91 day(s) 2 hour(s) 2 min.1:02:02
Sheet1
Cell Formulas
RangeFormula
B2:B9B2=SUMPRODUCT(VALUE(IFERROR(MID(0&A2,SEARCH({"d","h","m"},0&A2)-3,2),{0,0,0})),{3600,60,1})/86400
 
Upvote 0
Solution
Good day, I am still confused, can you please expand a bit more on how the formula fills in range (1 day, 2 days, etc) and on time/ late?
 
Upvote 0
Good day, I am still confused, can you please expand a bit more on how the formula fills in range (1 day, 2 days, etc) and on time/ late?
You said having trouble because of production information being not as time formatted. As I mentioned, my formula helps you to extract from your text string number data and converts them in the necessary format, using them in other calculations.
 
Last edited:
Upvote 0
Good day, I am still confused, can you please expand a bit more on how the formula fills in range (1 day, 2 days, etc) and on time/ late?

Is it what you want?

String date.xlsx
HIJKL
1Production TimeMonthRangeOn time / Late
2 4 hours 6 minutes4.10July1 DayOn time
3 3 hour(s) 7 min.3.12July1 DayOn time
4 2 hour(s) 58 min.2.13July1 DayOn time
51 day(s) 2 hour(s) 18 min.26.13July2 DaysOn time
6 6 hour(s) 6 min.6.10July1 DayOn time
72 day(s) 4 hour(s) 18 min.52.13July3-4 DaysLate
8 2 hour(s) 41 min.2.02July1 DayOn time
95 day(s) 2 hour(s) 2 min.122.03JulyOver 4 DaysLate
Sheet2
Cell Formulas
RangeFormula
K2:K9K2=IF(I2<24,"1 Day",IF(AND(I2>24,I2<52),"2 Days",IF(AND(I2>52,I2<96),"3-4 Days",IF(I2>96,"Over 4 Days"))))
L2:L9L2=IF(OR(K2="1 Day",K2="2 days"),"On time",IF(OR(K2="3-4 Days",K2="Over 4 days"), "Late"))
I2:I9I2=(DAY(SUM(MID(0&H2&"0000",FIND({"m","h","d"},0&H2&"xxmhd")-2,2)/{1440,24,1}))*24+HOUR(SUM(MID(0&H2&"0000",FIND({"m","h","d"},0&H2&"xxmhd")-2,2)/{1440,24,1}))+MINUTE(SUM(MID(0&H2&"0000",FIND({"m","h","d"},0&H2&"xxmhd")-2,2)/{1440,24,1}))/60)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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