Excel - Convert dates and currency as text to Excel dates and numbers respectively

12,361

Use the Text Import Wizard. You might have this option in the paste button that appears when you paste in your text. If not, it's in the Data tab of the ribbon. Click Text to Columns. When you get to step 3, import column A as Date: MDY. Then you shouldn't have to use the VALUE function for your dates.

Share:
12,361

Related videos on Youtube

Khalid
Author by

Khalid

I'm Dai, I'm currently a software engineer in Seattle doing the rounds on a variety of startups. I'm mostly familiar with the .NET stack. (Just don't call me a "full-stack" engineer - there's more to software than a "back-end" vs. "front-end" dichotomy: think about embedded and robotics, industrial control, avionics, systems programming with Rust, and so on!) Prior to the startup scene I was gainfully employed at Microsoft as a Software Engineer for the Chakra JavaScript engine (Edge and Internet Explorer), prior to that I worked on Expression Blend and Visual Studio. I like to think I have extensive experience in C# and the .NET Framework, and modest experience in C++. Prior to Microsoft I worked on web-applications and web-services using ASP.NET Web Forms, ASP.NET MVC, and WCF. I also have experience in PHP, Java and other non-Microsoft platforms and technologies for which I'm happy to answer questions about. Also: Everything is terrible. Life is short and love is always over in the morning.

Updated on September 18, 2022

Comments

  • Khalid
    Khalid over 1 year

    I frequently copy and paste HTML tables into Excel to do quick aggregate operations (e.g. sums, averages, etc).

    In this example, PayPal, their HTML table contains text values like

        A          | B       | C
    1 | Date       | Type    | Net
    2 | 5/14/2013  | Payment | $4.70 USD
    

    I want to get the actual Date and Currency values from this table into a format that Excel understands (note that my computer is set to "English (United Kingdom)" and I custom-set my Windows Short Date format to yyyy-MM-dd) and my default Excel currency is £ GBP.

    I create a new column in Excel, D, and set the cells to =VALUE( A2 ) and a Currency column E set to =VALUE( C2 ).

    However for both columns, D and E, Excel gives me the #VALUE! error (because it won't parse MM/dd/yyyy as a date as it expects yyyy-MM-dd, nor $x.xx USD as it expects £x.xx - so I need to get it to ignore both the initial currency symbol and the trailing 3-character name USD)

    I don't want to have to write an ugly string-parsing function in VBA (or worse, Excel formula syntax) to convert "$4.70 USD" into 4.7 or "5/14/2013" into 2013-05-14, but is there any other way?

  • Khalid
    Khalid over 8 years
    That works for dates, but what about the currency values?
  • benshepherd
    benshepherd over 8 years
    In that case, the formula =VALUE(LEFT(C2,FIND(" ",C2))) should chop the trailing "USD" off and convert the text to a number.