Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differentiate Numbers and Date in MSExcel

I am processing a large set of data. The data contain both numbers, String and Date. I want to differentiate between Date, String and Numbers. I am facing problem in differentiating between Numbers and Date.

I am currently using the below formula.

=(IF(TYPE(A1)=2,A1,TEXT(A1,"mmmm d, yyyy"))&"& "&IF(TYPE(B1)=2,B1,TEXT(B1,"mmmm d, yyyy"))&"& "&IF(TYPE(C1)=2,C1,TEXT(C1,"mmmm d, yyyy")))

If I give 1, It is formatting it as Date January 01, 1900

Even I tried ISNUMBER function, It's returning true for a date as well, e.g: ISNUMBER(10/01/1900).

like image 325
Sakthi Velan Avatar asked Nov 24 '25 11:11

Sakthi Velan


1 Answers

ISNUMBER doesn't work because dates are numbers in actual sense. It's just the formatting that makes them appears as dates. For example 00/01/1900 is 0 formatted as a date. The same applies for TYPE function as it will return a 1 for a number (whether the number is formatted as a number or date)

Use this:

=LEFT(CELL("format",A1),1)

It returns a d if A1 is formatted as date.

like image 78
Nitesh Halai Avatar answered Nov 27 '25 21:11

Nitesh Halai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!