How do I test for a default time value which is a result of a formula?

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
519
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am stumped by this one. In the attached minisheet, there is a default time/date value that gets calculated in cell D13.

The issue that this default value doesn't mean anything, and else where in the workbook, there is a formula "=D13".

This useless result is only calculated when I am dealing with historical data. When I am using future data, the value in D13 is a real time in 24hr format and is required. No problem.

What I was trying to do is something simple like if(d13<01-01-2000,"",D13"), but all I get is the #Value error.

Typically, when dealing with historical data, Excel will put something like "08-01-1900 12:00:00 AM" in D13.

How do I test for this?

Thanks in advance.

Book1
ABCDEFGHIJ
2
3
4
5
6
7
8RivertonTrackRIVERTON
9ConditionHeavy
10RivertonDistance (m)1200
11HeavyRace Number7
12ClassClass
131Time12:00 AM
14
152
16
173
18
194
20
215
22
236
24
257
26
270:00
281200m R7 The Red Door Mdn
29Final Results
30
31
32
33
34
35
36
37
38
39
Sheet1
Cell Formulas
RangeFormula
D8D8=UPPER(IF(B8="",B9,B8))
D9D9=IF(B11="",B10,IF(B9="",B11,"No Condition"))
D10D10=LET(s,FILTER(B8:B41,LEN(B8:B41)=MAX(LEN(B8:B41))),LEFT(s,FIND("m",s)-1)+0)
D11D11=LET(s,FILTER(B9:B41,LEN(B9:B41)=MAX(LEN(B8:B41))),MID(s,SEARCH("R",s,1)+1,2)+0)
D12D12=IF(ISERROR(F30),IF(ISERROR(G33="MDN HCP"),IF(ISNUMBER(G37),G33,IF(LEFT(G37,2)="BM",G37,IF(J37=1,G37,"BM" &G37))),G33),"Class "&G37)
D13D13=MIN(FILTER(B15:B41,ISNUMBER(B15:B41)))
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
firstly you have surrounded a cell reference in Quotes, so it will only return the text "D13".
But do you want
Excel Formula:
=IF(D13<"08-01-1900 12:00:00 AM","",D13)
 
Upvote 0
Thanks for that Michael, doing too many things at once and typing too fast. The quotes are not present in the actual formula. So I will stand corrected. Cheers.

This formula =IF(D13<"08-01-1900 12:00:00 AM","",D13), continues to return the the 12:00:00AM, when it would be great if I could get a blank in that space.
 
Upvote 0
Ok, why are you using a specific date AND time ??
Could you not restrict cell D13 ro either date OR time ??
Being so specific, I believe will cause a few errors
 
Upvote 0
Hi Michael, I am not using a specific date and time. It is an assumed value by Excel that is being pasted from the clipboard. Everything in the range B8:B37 is being pasted in one go.

Then the formula in D13, is creating this default time.

If there is an actual time in the clipboard, as there is future data, the formula simply extracts the time and plonks it in D13. No Drama

If there is no actual time in the clipboard , as there is in past results, the formula is creating this default time of 12:00 AM.

Elsewhere in the workbook, I would prefer not see this 12:00 AM at all, hence the reason, why I am trying to test for it, so I can eliminate it.

Also, I don't think the 12:00 AM is an actual time. I suspect it is being treated as something else

Thanks for your help.
 
Upvote 0
Maybe
Excel Formula:
=IF(D13=INT(D13),"",D13)
 
Upvote 0
Solution
Hi Mark 858. That is perfect :) Hit the nail right on the head.

Thank you
 
Upvote 0
You're welcome.
Just remember that a time is just the decimal part of a number formatted as time, your formula results in the Integer 2 or 2.00 if formatted to 2 decimal places.

The .00 formatted as time would produce 00:00:00 or 12:00:00 AM.
All the formula does is test if D13 is an Integer.
 
Upvote 0

Forum statistics

Threads
1,215,493
Messages
6,125,126
Members
449,206
Latest member
burgsrus

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