+ Reply to Thread
Results 1 to 11 of 11

Extracting Multiple Number Values from Text cells into separate cells

  1. #1
    Registered User
    Join Date
    09-13-2016
    Location
    Florida
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Post Extracting Multiple Number Values from Text cells into separate cells

    I am interested in

    These are the typical text cell values I have in lets say column A.

    Interval
    144 MO
    OR
    12000 FC
    100 MO
    OR
    10000 FC
    OR
    15000 FH
    14800 FC
    OR
    29700 FH
    10200 FC
    OR
    20500 FH
    12 YE
    OR
    13300 FC
    OR
    57100 FH


    Looking for a way to extract the numeric values from the text and place them into columns B, C, D while also converting calendar values to (i.e. YR=year, MO=month, DY=days in to a day value like this:

    Days FH FC
    4,380 12,000
    3,041 15,000 10,000
    29,700 14,800
    20,500 10,200
    4,380 57,100 13,300

    Thanks for advance for any assistance or clues you can offer.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,364

    Re: Extracting Multiple Number Values from Text cells into separate cells

    Try

    In B

    =IFERROR(INT((LEFT($A1,FIND("MO",$A1)-1)+0)/12*365),"")


    In C

    =IFERROR(MID($A2,FIND("FH",$A2)-6,5)+0,"")

    in D

    =IFERROR(MID($A1,FIND("FC",$A1)-6,5)+0,"")

  3. #3
    Registered User
    Join Date
    09-13-2016
    Location
    Florida
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Extracting Multiple Number Values from Text cells into separate cells

    Hi JohnTopley,
    The formula provided is a step in the right direction. I have applied it an have come across these issues.

    With respect to your formula in Column B
    The formula works - I will have to apply some form of ELSE / IF formula to capture the requirements if the value is expressed in YR or DY instead of MO.

    With respect to your formula in Column C
    This formula captures the requirement perfectly if the FH numeric value FC is 5 digits. There are times when I have FH values spanning 1 to 6 digits long (i.e.,. 7 FH or 105000 FH).

    With respect to your formula in Column D
    This formula captures the requirement perfectly if the FC numeric value FC is 5 digits. There are times when I have FC values spanning 1 to 6 digits long (i.e., 1 FC or 100000 FC).

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,364

    Re: Extracting Multiple Number Values from Text cells into separate cells

    Try ..


    data starting row 2

    in Column B

    =SUBSTITUTE(SUBSTITUTE($A2,CHAR(10),"/"),"/OR",""

    in C

    =IFERROR(INT((LEFT($B2,FIND("YR",$B2)-1)+0)*365),IFERROR(INT((LEFT($B2,FIND("MO",$B2)-1)+0)/12*365),LEFT($B2,FIND("DY",B2)-1)+0))

    in D (FC)

    =IFERROR(MID($B2,FIND("/",$B2)+1,FIND("FC",$B2)-FIND("/",$B2)-2),"")

    in E (FH)

    =IFERROR(MID($B2,FIND("FC/",$B2)+3,FIND("FH",$B2)-FIND("FC/",$B2)-2),"")
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-13-2016
    Location
    Florida
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Extracting Multiple Number Values from Text cells into separate cells

    Thanks JohnTopley

    Nice approach!

    The formula on the spreadsheet you attached has a different formula in cell D2 vs. D3 and D4 - also noticed a different formula in between E2 vs. E3 and E4. Is this by design and the formula can repeats from row 3 onwards? This is highlighted in yellow cells on the attached spreadsheet.

    The formula in Column B seems to work well with all combinations of data.

    The formula in Column C, D, E work in the scenarios presented by myself. The current issue is that IF the values in Column A are not in the same YR FH FC sequence (i.e, 100 FC OR 100 FH vs. 100 FH OR 100 FC) the the formulas result present a #VALUE. I noticed some other issues when Column A is a single FC or FH value (i.e, 100 FH).

    I have added some examples of where it does not work and highlighted in RED font where an answer is expected. I will change the items in ORANGE font to show BLANK because there is no result to be expected.

    Perhaps an array can be incorporated into your formula as described in https://exceljet.net/formula/split-t...d-numbers?????
    Attached Files Attached Files
    Last edited by skydoc; 09-13-2016 at 04:45 PM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,364

    Re: Extracting Multiple Number Values from Text cells into separate cells

    I resorted to VBA:

    Firewall will not let me post the code!!!
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,924

    Re: Extracting Multiple Number Values from Text cells into separate cells

    See this ...
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,364

    Re: Extracting Multiple Number Values from Text cells into separate cells

    Formula in B

    =IFERROR(LOOKUP(10^10,--MID($A2,SEARCH("DY",$A2)-ROW($1:$10),ROW($1:$10))),IFERROR(INT(LOOKUP(10^10,--MID($A2,SEARCH("MO",$A2)-ROW($1:$10),ROW($1:$10)))/12*365),IFERROR(LOOKUP(10^10,--MID($A2,SEARCH("YR",$A2)-ROW($1:$10),ROW($1:$10)))*365,"")))
    Attached Files Attached Files
    Last edited by JohnTopley; 09-14-2016 at 08:29 AM.

  9. #9
    Registered User
    Join Date
    09-13-2016
    Location
    Florida
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Extracting Multiple Number Values from Text cells into separate cells

    It works great!!!! You are Brilliant!!!!

    I am studying the formula to try to understand the use of ^ and ROW ($1:$10).

    Thank you so very much!

  10. #10
    Registered User
    Join Date
    09-13-2016
    Location
    Florida
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Re: Extracting Multiple Number Values from Text cells into separate cells

    Thanks Phuocam,

    You are Awesome!!!

    I am studying both of your formulas to understand the use of 10^10 and ROW application.

    Thanks a bunch!
    Last edited by skydoc; 09-14-2016 at 10:11 AM.

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,924

    Re: Extracting Multiple Number Values from Text cells into separate cells

    You're welcome!

+ 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. Splitting Cells with multiple values into separate rows
    By dracon6 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2014, 12:53 AM
  2. [SOLVED] Extracting Text into separate cells
    By KeithWoollacott in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2013, 11:02 AM
  3. [SOLVED] Multiple text values in 1 cell separating into two cells in number format
    By Mengo85 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-08-2013, 10:50 AM
  4. vlookup return multiple values into separate cells
    By hmm321 in forum Excel General
    Replies: 5
    Last Post: 04-05-2012, 12:59 AM
  5. How to separate multiple cells values in an email
    By marchew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2011, 01:32 AM
  6. Using Text to Columns on multiple but separate cells
    By rosef in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-25-2009, 03:02 PM
  7. Return multiple values in separate cells
    By fg2009 in forum Excel General
    Replies: 5
    Last Post: 07-21-2009, 09:11 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