Bring only date from time/date field in Excel 2007

ComputerCharmer

New Member
Joined
Jun 27, 2011
Messages
5
I am using vlookup to bring the contents of a cell into a different worksheet. I only need the date from a time/date field. Since time is expressed as a decimal, can I accomplish this by using INT in my formula? Thank you!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Have you tried formatting the cell where the vlookup returns the value?

A______B
1-----2/2/2011 12:00:00
2-----3/3/2011 12:00:00



C
=vlookup(1,A1:B2,2,0)

formatted as date c1=2/2/2011

Formatted as time c1=12:00:00




Will this work for you?
 
Upvote 0
yes, use =INT(VLOOKUP(...))

You may need additional error handling for when the value returned is non-numeric, in XL07 or later you can put =IFERROR(... ,0) around it, else you will need IF(ISERROR(....) , 0, ....)
 
Upvote 0
I have imported a query that I created in Access into an Excel spreadsheet. I can format that cell to appear in the desired manner. My problem is occuring in my VLOOKUP on a different spreadsheet. The formula is pulling the time and date. And as you know, the cell that contains my formula cannot be formatted as a date. I am thinking that I either need to add another conditional formatting rule or adjust my formula. Do you Agree or Disagree with my logic?
 
Upvote 0
so is it returning a value or a text string?

If its the latter, try adjusting your formula to =(....)+0 to force it to return a value
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

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