+ Reply to Thread
Results 1 to 3 of 3

Chopping a cell value?

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    104

    Chopping a cell value?

    Hi Forum,
    Could you help me on this.
    I have the following variable called "File_Size" and its values are like below.

    File_Size
    616MB
    1GB
    616MB

    Q: I wanted to get the numeric portion out and create a new variable called New_var.

    Answer:
    New_var
    616
    1
    616

    My attempt:
    I used left function like below but I have to define several lengths depending on the number of numerics in each cell values which is not possible given I have several thousand datasets.

    =left(text, 3)

    Could someone help me?
    Thanks
    Mirisa

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Chopping a cell value?

    Well, since the last two characters will always be KB, MB, GB, TB you can use: =LEFT(A1,LEN(A1)-2).
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    104

    Re: Chopping a cell value?

    Hello Dflak,
    Your code works great!
    Thank you so much.
    Mirisa

+ 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] When one cell equals value of another cell, then third cell displays text of fourth cell?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2021, 02:12 PM
  2. [SOLVED] How to create/run "cell A equals Cell B put Cell C info in Cell D
    By abmb161 in forum Excel General
    Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  3. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  4. Replies: 1
    Last Post: 11-03-2012, 09:05 PM
  5. range.Value = a() chopping off decimals
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-02-2009, 11:49 AM
  6. [SOLVED] Chopping the last 4 characters of a string in VBA
    By silkworm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2005, 01:10 AM
  7. Replies: 10
    Last Post: 06-18-2005, 12:05 PM

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