+ Reply to Thread
Results 1 to 5 of 5

Data Extraction and Sort from a single column

  1. #1
    Registered User
    Join Date
    05-30-2019
    Location
    Mississipi
    MS-Off Ver
    MS Office Home and Business 2013
    Posts
    67

    Data Extraction and Sort from a single column

    I would like to extra data from a cell and sort specific parts of that data into individual cells.
    Example: cell A2 contains ?zometa 4 mg/5ml conc?
    1. I would like to extract the first numerical number ?4? and place that number in column B,
    2. The second piece of data I would like to extra will be the ?MG? or ?MCG? or ?GM? or ?UNIT?, I would like to place this value in Column C.
    3. The third piece of data I would like to single out will be volume size or package, this will be of numerical value. If not number is present it needs to default to ?1?, I would like to place this value into Column D
    4. The fourth piece of data I would like to single out will be the Measure, this will value will be either ?ML? or ?L?, I would like to place this data into column E

    The table I am pulling from the MG, MCG, GM, UNIT, ML and L will always be upper case or capitalized.

    Would this be possible?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Data Extraction and Sort from a single column

    Here is as far as I have gotten so far. Please tell us the correct values for the cells that are displaying errors or incorrectly displaying blanks.
    For strength: =MID(A2,AGGREGATE(15,6,SEARCH({1,2,3,4,5,6,7,8,9},A2),1),SEARCH("|",SUBSTITUTE(A2," ","|",2))-AGGREGATE(15,6,SEARCH({1,2,3,4,5,6,7,8,9},A2),1))
    For unit: =INDEX(R$2:R$5,AGGREGATE(15,6,(ROW(R$2:R$5)-ROW(R$1))/ISNUMBER(FIND(R$2:R$5,A2)),1))
    For package**: =IF(FIND(S$2:S$3,A2)=SEARCH("/",A2)+1,1,MID(A2,SEARCH("/",A2)+1,FIND(S$2:S$3,A2)-SEARCH("/",A2)-1))
    For measure: =INDEX(S$2:S$3,AGGREGATE(15,6,(ROW(S$2:S$3)-ROW(S$1))/ISNUMBER(FIND(S$2:S$3,A2)),1))
    **denotes an array formulas which is not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    05-30-2019
    Location
    Mississipi
    MS-Off Ver
    MS Office Home and Business 2013
    Posts
    67

    Re: Data Extraction and Sort from a single column

    This is AWESOME!!! This works, the sells that have a range strength are not as important, and can be discarded, but as a whole this saves me a ton of time

  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,063

    Re: Data Extraction and Sort from a single column

    Try this as an alternative (four separate array formulae that each need CTRL-SHIFT-ENTER) using FILTERXML:

    =FILTERXML("<A><B>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"/"," "),"ML "," ML "),"-"," ")," ","</B><B>")&"</B></A>","//B[number()=.][1]")
    Attached Files Attached Files
    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

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Data Extraction and Sort from a single column

    Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Replies: 3
    Last Post: 03-22-2014, 08:35 AM
  2. [SOLVED] Data Extraction from one column
    By taposh.roy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-14-2013, 08:29 AM
  3. SIMPLE data extraction form Column A to B
    By mecutemecute in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-15-2013, 10:09 AM
  4. Replies: 5
    Last Post: 12-20-2010, 06:59 AM
  5. [SOLVED] data extraction from a series/column
    By Sedge in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-05-2010, 10:31 PM
  6. automate single cell data extraction and matching...
    By soundchaser77 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2009, 10:19 PM
  7. Data Extraction And Sort
    By Terrance in forum Excel General
    Replies: 0
    Last Post: 11-20-2007, 04:49 PM
  8. [SOLVED] a sort of GROUP BY data extraction question...
    By jc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2006, 03:55 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