How to format a date pulled from another workbook

phillipc1

New Member
Joined
Oct 11, 2023
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am working on a solution to pull a date from one workbook to another, but I would like the format to change via the formula I am using. What formula can I use to achieve this?

Source date format example:
Apr 13, 2022, 11:40:54 AM

Destination date format example:
4/13/2023

This is the formula I am currently using, and I have the iferror added into it as I want this formula to match essentially all values (dates) in column "G" of the source workbook to column "D" of this new workbook. In the event there is no data, it leaves the field blank. If anyone also has an easier way to go about that, I would appreciate it.
Excel Formula:
=IFERROR('2023-11-08_Devices_Lytx.csv'!$G2,"")

Destination Workbook:
1699459788706.png


Source Workbook:
1699459813834.png
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try this:
Excel Formula:
=IFERROR(TEXT('2023-11-08_Devices_Lytx.csv'!$G2,"m/d/yyyy"),"")
 
Upvote 0
Hi Joe,

As soon as I read your response it clicked. I forgot about that route. However, it looks like I am still encountering the same issue. Perhaps a little more insight into this process may help.

The source workbook is a csv report pulled from a vendor's site and as such the field we have as our date is in a "General" format. The goal is that we can pull this report daily and save it over the existing file which will then feed into our destination workbook. The data in our destination workbook is used to run different pivot tables and analysis in conjunction with other data we have.
 
Upvote 0
Can you tell me what this formula returns if you enter it into any empty cell?
Excel Formula:
=ISNUMBER('2023-11-08_Devices_Lytx.csv'!$G2)

If that returns FALSE, it means the entry in a text one, in which case, try this formula:
Excel Formula:
=IFERROR(TEXT(DATEVALUE(TEXTBEFORE('2023-11-08_Devices_Lytx.csv'!$G2,",",2)),"m/d/yyyy"),"")
 
Upvote 0
Solution
That did it! The entry was returning as false so I utilized the second formula provided which did the trick. Thank you so much!
 
Upvote 0
You are welcome!
Glad I was able to help!
:)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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