+ Reply to Thread
Results 1 to 4 of 4

Need help querying column and manipulating data

  1. #1
    Registered User
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Need help querying column and manipulating data

    Hello all,

    This is probably a very basic question, but I am new to Excel.

    I am pulling information from a finance source (Yahoo! Finance) into a spreadsheet and need to parse the data a little bit.

    Yahoo reports income statement figures for companies in billions of dollars (i.e. "1.45b" is the way it is written after import). I need to convert this data to millions if it is in billion or leave it in millions if it's not...so convert 1.45b to 1450 and keep something like 987.7m as 987.7 to then use in another spreadsheet.

    I have been doing this by hand by having a separate column dedicated to multiplying every billion figure by 1000 to get millions. Obviously this isn't the ideal way of doing this.

    Can I somehow query that entire column for figures that contain "b" OR "m", and if the figure contains "b", strip the "b" out of it, multiply it by 1000 and copy to the next column? Similarly if a figure contains "m", just strip the "m" and copy to next column.

    I hope this makes sense...

    Thanks in advance!

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Need help querying column and manipulating data

    Maybe

    =IF(RIGHT(A1,1)="m",A1,LEFT(A1,LEN(A1)-1)*1000&"m")

    If you don't want the "m" attachment then

    =LEFT(A1,LEN(A1)-1)*IF(RIGHT(A1,1)="b",1000,1)
    Last edited by Cutter; 05-07-2012 at 01:30 PM.

  3. #3
    Registered User
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Need help querying column and manipulating data

    Quote Originally Posted by Cutter View Post
    Maybe

    =IF(RIGHT(A1,1)="m",A1,LEFT(A1,LEN(A1)-1)*1000&"m")

    If you don't want the "m" attachment then

    =LEFT(A1,LEN(A1)-1)*IF(RIGHT(A1,1)="b",1000,1)
    You are the master! THANK YOU!

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Need help querying column and manipulating data

    You're welcome. Don't forget to mark your thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1