Date Format

wid2001

New Member
Joined
Jan 30, 2014
Messages
28
I am scraping data from a flight planning website that brings a date value into a cell like this: "Tue. 7/26". Currently I have the formula "=RIGHT(X42,2)" to extract the day and "=MID(X42,6,1)" to extract the month. This formula doesn't work all of the time depending on whether or not the day is 1 or 2 digits. For the above example I have to modify it to "=RIGHT(X42,3)". I know there is probably a better solution than modify the formula every time its a two digit or single digit day. I need the day and month seperated and available for other calculations. Anyone have any ideas?

Thanks
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
maybe something like....

=DAY(REPLACE(A2,1,FIND(" ",A2),"")+0)
=MONTH(REPLACE(A2,1,FIND(" ",A2),"")+0)

?
 
Upvote 0
That seems to be working great. Thanks for the reply! I will try and break it but that seems to have solved my problem.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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