+ Reply to Thread
Results 1 to 5 of 5

How to Convert " ## to ##" to "##"?

  1. #1
    Registered User
    Join Date
    11-14-2016
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    2

    How to Convert " ## to ##" to "##"?

    Hello All Excel pros

    This is excel noob here
    I am trying to convert a string of values that are all "01 to 03" or "04 to 06" to a certain value.
    For example, for "01 to 03" i want to give it a value, 3 on the cell beside.
    How could I do that with formula or conditional formatting? Please advice.

    Thanks!
    Last edited by excelLent101; 11-14-2016 at 11:35 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to Convert " ## to ##" to "##"?

    1) Create a two-column table for reference.

    For instance:
    column M = string to match
    column M = result you would want

    2) Then use a VLOOKUP() formula to check your strings against the lookup table and bring back the wanted value.

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    1
    Code
    Results
    String
    Result
    2
    02 to 04
    7
    =VLOOKUP(A2,M:N, 2, 0)
    01 to 03
    3
    3
    01 to 03
    3
    02 to 04
    7
    4
    03 to 05
    11
    5
    05 to 09
    13
    6
    7
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-14-2016
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    2

    Re: How to Convert " ## to ##" to "##"?

    Hey thank you so much, I think I understand how it works now.
    However, just curious, please correct me if I'm wrong.

    In the formula Vlookup(H4, M:N, 2,0)
    H4 is the data set given
    M is the reference column, and M contains unique sets of values identical to H, and N contains the value i want to put it.
    But what is the rationale or explanation for "2,0"?

  4. #4
    Forum Contributor
    Join Date
    08-23-2016
    Location
    India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    194

    Re: How to Convert " ## to ##" to "##"?

    2 stands for second column in M:N
    0 stands for 'Exact Match'

    it will get the exact match from second column which is column N
    Ash

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to Convert " ## to ##" to "##"?

    Please use Excel's builtin HELP files for things like this. Press F1 and enter the function you want the details for. They are quite good and at your fingertips.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] Convert from "general" (YYYYMMDD) to specific "custom" format (YYYY.MM.DD)
    By Ella_p in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 02:23 AM
  2. [SOLVED] Excel 2007: How to Convert "5/2/2013" to "May" then subtract a Month so it's "Apr"
    By Golom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 02:00 AM
  3. [SOLVED] How to convert "26:38:00" to "26:38" when the cell is formatted as Time?
    By PistachioPedro in forum Excel General
    Replies: 2
    Last Post: 11-15-2013, 06:49 PM
  4. Replies: 8
    Last Post: 12-31-2012, 05:19 PM
  5. convert "15000" to "Fifteen thousand" in excel cell?
    By anurag in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-04-2006, 03:10 AM
  6. can we convert "2 days 16 hrs" to " 64hrs" using excel functions
    By chris in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2006, 07:55 PM
  7. Replies: 1
    Last Post: 01-07-2006, 11:30 PM
  8. convert a number in Excel from numeric to text, i.e. "1" to "one"
    By buenavisionpaul in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-27-2005, 03:06 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