+ Reply to Thread
Results 1 to 11 of 11

how to extract multiple rows of data based on a single row value?

  1. #1
    Registered User
    Join Date
    01-06-2018
    Location
    alex
    MS-Off Ver
    Microsoft Excel 2019 MSO (Version 2301 Build 16.0.16026.20196) 32-bit
    Posts
    48

    Question how to extract multiple rows of data based on a single row value?

    Hello,
    I hope my title can explain what aim to do.
    I've been doing the work manually, using filters and pivots, but after being on leave for 2 months, I came back to a 36k lines.
    I hope you guys can give me a pointer if excel can automate this for me.

    The situation as follows:

    The main list contains all billing details for all the items and medications charged on the patient.
    I need to extract only data based on patient date of visit (ISSUE DATE - columns D) and only patients that was issued the item"CHEMOPREPARATION-1" (ITEM NAME - columns B)
    The tricky part is I know that I can filter the needed patients (REGISTRATION NO) with the chemopreparation-1 line, but how to get the other items charged in the same date for the same patient as well?

    And moreover, how to extract that data into a tabular form.

    sorry for time it took you guys to read, but hope you get what i want.
    I will attach what i do manually, hope you can help me as always.

    Appreciate your work.
    Attached Files Attached Files
    Last edited by resiexfor; 02-04-2020 at 02:32 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,995

    Re: how to extract multiple rows of data based on a single row value?

    Please attach a sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-06-2018
    Location
    alex
    MS-Off Ver
    Microsoft Excel 2019 MSO (Version 2301 Build 16.0.16026.20196) 32-bit
    Posts
    48

    Re: how to extract multiple rows of data based on a single row value?

    I'm trying to upload attachment but it's not showing!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,995

    Re: how to extract multiple rows of data based on a single row value?

    Are you following the instructions in the yellow banner at the top? If you do, it will work.

  5. #5
    Registered User
    Join Date
    01-06-2018
    Location
    alex
    MS-Off Ver
    Microsoft Excel 2019 MSO (Version 2301 Build 16.0.16026.20196) 32-bit
    Posts
    48

    Re: how to extract multiple rows of data based on a single row value?

    Uploaded, sorry the file exceeded the size limit and I wasn't aware of that.

  6. #6
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: how to extract multiple rows of data based on a single row value?

    resiexfor. You would like to see list of items with ISSUE DATE the same as CHEMOPREPARATION-1 was and REGISTRATION NO , is't it?

    It could be done by advanced filter but it will be very slow. Because you still use 2007 PowerQuery is not available for you and I see only two ways VBA and MSQuery.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by BMV; 02-04-2020 at 05:32 AM. Reason: File was replaced

  7. #7
    Registered User
    Join Date
    01-06-2018
    Location
    alex
    MS-Off Ver
    Microsoft Excel 2019 MSO (Version 2301 Build 16.0.16026.20196) 32-bit
    Posts
    48

    Re: how to extract multiple rows of data based on a single row value?

    Yes, That's exactly what i want, this file was created on work computer .. I have excel 2013 at home.

    and wow.. you managed to summarize my whole post in one line.
    Last edited by AliGW; 02-04-2020 at 06:46 AM. Reason: Please don't quote unnecessarily!

  8. #8
    Registered User
    Join Date
    01-06-2018
    Location
    alex
    MS-Off Ver
    Microsoft Excel 2019 MSO (Version 2301 Build 16.0.16026.20196) 32-bit
    Posts
    48

    Re: how to extract multiple rows of data based on a single row value?

    I can't view the changes you've made to the file on this computer,, If you can tell me how you added the code?
    I will view it at home,, really appreciate your help.

    Thanks

  9. #9
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: how to extract multiple rows of data based on a single row value?

    you managed to summarize my whole post in one line
    just because it easy for me to develop solution then write in English :-)
    MSQuery solution will work with any Excel . Macro is only for correct path to work book in the connection string.

    CHEMOPREPARATION-1 - can be as parameter but some changes have to be done in this case.

    I have to replace file because I forgot to write short macro.

  10. #10
    Registered User
    Join Date
    01-06-2018
    Location
    alex
    MS-Off Ver
    Microsoft Excel 2019 MSO (Version 2301 Build 16.0.16026.20196) 32-bit
    Posts
    48

    Re: how to extract multiple rows of data based on a single row value?

    Hello,
    I can't replicate the fix, @BMV posted.

    Hope you can help me out.

    Thanks.

  11. #11
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: how to extract multiple rows of data based on a single row value?

    resiexfor, The other way
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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] Extract data to multiple rows based on value in separate cell
    By jehster1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-24-2018, 02:41 AM
  2. Split Single Row into multiple rows based on column data
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2017, 01:57 PM
  3. Replies: 3
    Last Post: 04-28-2017, 03:21 PM
  4. Replies: 1
    Last Post: 04-06-2016, 07:02 AM
  5. Displaying data from multiple rows in single row based on data values
    By Marnus in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-24-2014, 03:57 PM
  6. Replies: 0
    Last Post: 10-16-2012, 03:26 PM
  7. Delete multiple rows of data based on criteria in a single cell
    By slaga9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2011, 03:41 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