Converting Date to real Numbers

erock24

Well-known Member
Joined
Oct 26, 2006
Messages
1,161
I am trying to perform a lookup but my fields are not true.
1 field is a date field formatted yyyymmdd. the other field I think was hard coded what the 1st field showed. For example, the 1st field is 3/01/98 but shows 19980301. So, the 2nd field is 19980301.
I've been trying to get these field to equate but every time I try to convert my date field I get the excel number that equals the date 35855.

Any Ideas?
Thank you for your time and help.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
Eh, 35855 is correct.:)

Excel stores numbers as integers.

eg today 27th July 2007 ͌͌͌͌= 39290
 

erock24

Well-known Member
Joined
Oct 26, 2006
Messages
1,161
I know but 35855 does not = 19980301
I need to either make the date field that is formatted yyyymmdd to actually be what it shows (19980301) or make the field that is 19980301 be a date field. I need to make these 2 fields equal so I can do lookups off of them. I'm trying to make sense, I don't know how else to say it.
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
If the numbers in your table (the 19980301 type numbers) are actual numbers, then perhaps something like this:

=VLOOKUP(TEXT(A1,"yyyymmdd")+0,B:C,2,0)

If the numbers in your table are text, drop the +0 part.
 

Forum statistics

Threads
1,181,649
Messages
5,931,216
Members
436,784
Latest member
amuljono

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
Top