+ Reply to Thread
Results 1 to 11 of 11

remove specific text from certain cells, then multiply the numerical value left by 0.001

  1. #1
    Registered User
    Join Date
    06-21-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    4

    remove specific text from certain cells, then multiply the numerical value left by 0.001

    Want to keep an eye on the accuracy of my ISP's usage meter
    The ISP provides me with daily info expressed in GB's

    I am watching usage using pfSense vnstat2, this gives me a table of readings i can cut n' paste into excel
    The problem is that those readings are mixed number/data e.g.
    12 June "12.1 GB"
    13 June "345 MB"
    14 June "256 MB"
    15 June "34.0 GB"

    etc

    So I can remove the GB and associated space before it with replace function, replacing with nothing
    But is there any way to have a function or a macro to find all cells with " MB" in them, remove the " MB", then multiply by 0.001 to convert to GB's?

    The other less accurate option would be to replace all such cells with 0.0005, approximating to their GB value, or just replacing with "0", as these small values have little influence on accuracy of data meters

    But I was hoping to automate this as above, both as a learning exercise and to get fully accurate

    Thanks
    Jeff

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    12 June "12.1 GB" is all in one cell?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    Is this what you want?

    =--SUBSTITUTE(SUBSTITUTE(TRIM(MID(SUBSTITUTE(A1,"""",REPT(" ",255)),255,255))," MB","")," GB","")*0.001

    A
    B
    1
    12 June "12.1 GB"
    0.0121
    2
    13 June "345 MB"
    0.345
    3
    14 June "256 MB"
    0.256
    4
    15 June "34.0 GB"
    0.034


    Or this:

    =IF(ISNUMBER(FIND("MB",A1)),--SUBSTITUTE(TRIM(MID(SUBSTITUTE(A1,"""",REPT(" ",255)),255,255))," MB","")*0.001,SUBSTITUTE(TRIM(MID(SUBSTITUTE(A1,"""",REPT(" ",255)),255,255))," GB","")+0)
    Last edited by AlKey; 06-21-2014 at 01:46 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    Try this (assumes all in once column, starting A1.

    Total brute force, I'm afraid...

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-21-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    4

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    Sorry, I should have been more specific
    Thanks fro quick replies

    Date is in a column on its own - thats fine
    Next columns have similar usage data - there is a number value, a space and then eith MB or GB
    So each column I am interested in look like:
    12.1 GB
    345 MB
    256 MB
    34.0 GB

    etc

    There are more than one relevant column of data, as I have some of internet going thru VPN, some out on ISP Ip, in the end all thru ISP

    Thanks
    Jeff

  6. #6
    Registered User
    Join Date
    06-21-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    4

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    A correct version of this would look like:

    12.1 GB becomes 12.1
    345 MB becomes 0.345
    256 MB becomes 0.256
    34.0 GB becomes 34.0

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    So all you want is the numbers out in another column with GB or MB?

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    Quote Originally Posted by jeffnoone View Post
    A correct version of this would look like:

    12.1 GB becomes 12.1
    345 MB becomes 0.345
    256 MB becomes 0.256
    34.0 GB becomes 34.0
    See second formula in post #3

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    Always easier if you post a sheet rather than a "Table" or (worse still...) a screenshot). This is not as ugly, and assumes data are in A1

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-21-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    4

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    Many thanks Glenn and Alkey
    That does the trick
    Jeff
    Last edited by jeffnoone; 06-21-2014 at 02:47 PM.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: remove specific text from certain cells, then multiply the numerical value left by 0.0

    If that's it - can you please mark the thread as solved & (preferably) click the Add Reputation button at the foot of the post(s) of those who helped.

    Cheers...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Remove specific text from a cell and than sort cells by month and date
    By Boo123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2014, 05:05 PM
  2. How to treat specific text as numerical value
    By HavokJak in forum Excel General
    Replies: 2
    Last Post: 05-17-2014, 11:23 PM
  3. [SOLVED] Left of decimal with numerical and text values
    By Bearack in forum Excel General
    Replies: 5
    Last Post: 09-20-2012, 12:07 PM
  4. Replies: 2
    Last Post: 12-28-2011, 11:22 PM
  5. Remove specific text from only certain cells
    By amoorman in forum Excel General
    Replies: 4
    Last Post: 02-09-2009, 08:48 AM

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