+ Reply to Thread
Results 1 to 9 of 9

extract data from multiple columns and rows to make a single list

  1. #1
    Registered User
    Join Date
    01-31-2012
    Location
    Australia
    MS-Off Ver
    OFFICE 365
    Posts
    34

    extract data from multiple columns and rows to make a single list

    Sorry but i need some more help.

    I am trying to make a "Meal Register-Catering" list which will extract only the dietary requirements as detailed on another worksheet (Ward List).

    As the list of dietary requirements could be extensive, I just want to capture exactly what is in the Ward List worksheet's "dietary requirements" column
    If possible I am hoping to create a compact list with no empty lines between each entry.

    I have been trying to figure this out for some days to no avail, so any assistance would be greatly appreciateed.

    Thanks

    Paul
    Attached Files Attached Files
    Last edited by pvwebster; 04-10-2020 at 05:52 AM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: extract data from multiple columns and rows to make a single list

    You need to append data in WARD LIST.

    Then
    Meal Register - Catering
    A4:B4
    =IFERROR(INDEX('WARD LIST'!B:B,AGGREGATE(15,6,ROW('WARD LIST'!$I$3:$I$155)/('WARD LIST'!$I$3:$I$155<=$E$2)/('WARD LIST'!$J$3:$J$155>=$E$2)/('WARD LIST'!$G$4:$G$155>""),ROWS(A$4:A4))),"")

    D4
    =IF(A4="","",INDEX('WARD LIST'!G:G,AGGREGATE(15,6,ROW('WARD LIST'!$I$3:$I$155)/('WARD LIST'!$I$3:$I$155<=$E$2)/('WARD LIST'!$J$3:$J$155>=$E$2)/('WARD LIST'!$G$4:$G$155>""),ROWS(D$4:D4))))
    Attached Files Attached Files

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: extract data from multiple columns and rows to make a single list

    I've set this up for you in the attached file.

    I've used the grey columns in your Ward List sheet as helper columns, with this formula in A4:

    =IF(G4<>"",MAX(A$3:A3)+1,"")

    This can be copied across into O4, AC4 and AQ4, and then copied down to row 38, but delete the formulae in A20:A22 and O20:O22 to avoid the repeated headings. This formula generates a unique sequential number where there is a dietary requirement specified, but we want this number to increase for each block of data. Consequently, I have also used this formula in O3:

    =MAX(A:A)

    which will give the starting point for column O as the largest number that had been reached in column A. I have coloured this white for clarity, and then this can be copied into AC3 and AQ3 (I've also put zero in A3, for completeness).

    I've used column K in the Meal Register sheet as another helper, with this (long) formula in K4:

    =IF(COUNTIF('WARD LIST'!A:A,ROWS($1:1)),"1_"&MATCH(ROWS($1:1),'WARD LIST'!A:A,0),IF(COUNTIF('WARD LIST'!O:O,ROWS($1:1)),"2_"&MATCH(ROWS($1:1),'WARD LIST'!O:O,0),IF(COUNTIF('WARD LIST'!AC:AC,ROWS($1:1)),"3_"&MATCH(ROWS($1:1),'WARD LIST'!AC:AC,0),IF(COUNTIF('WARD LIST'!AQ:AQ,ROWS($1:1)),"4_"&MATCH(ROWS($1:1),'WARD LIST'!AQ:AQ,0),"-"))))

    It will return the block number and the row in that block where those sequential numbers occur, separated by an underscore. Copy this down to the bottom of your data.

    The Ward data can be retrieved using this formula in A4:

    =IF(OR($K4="",$K4="-"),"",INDEX('WARD LIST'!$B$1:$BD$38,RIGHT($K4,LEN($K4)-FIND("_",$K4)),14*(LEFT($K4)-1)+COLUMNS($A:A)))

    This can be copied into B4, and both formulae copied down as required.

    The Dietary data uses a slightly simpler formula in D4:

    =IF(OR($K4="",$K4="-"),"",INDEX('WARD LIST'!$B$1:$BD$38,RIGHT($K4,LEN($K4)-FIND("_",$K4)),14*(LEFT($K4)-1)+6))

    as this does not follow the same sequence of columns.

    Hope this helps.

    Pete

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: extract data from multiple columns and rows to make a single list

    Hi, I interpreted the ask slightly differently to Bo_Ry i.e. presumed active where no discharge date.

    To address current layout I used a key [RC co-ordinate] for subsequent index calls - but also AGGREGATE dependent.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-22-2020
    Location
    Malaysia
    MS-Off Ver
    2013 and 365 Pro Plus
    Posts
    56

    Re: extract data from multiple columns and rows to make a single list

    All the above is great, this is mine... which is not great... but since I have made it for a few hour... so I upload it anyway

    My main objective is not to use Index and Match

    Just my personal preference

    I added a few feature

    1. Option to display all patient or just the one who need special requirement
    2. How many menu to prepare

    Capture.JPG
    Attached Files Attached Files
    Last edited by biex; 04-10-2020 at 09:27 AM.

  6. #6
    Registered User
    Join Date
    01-31-2012
    Location
    Australia
    MS-Off Ver
    OFFICE 365
    Posts
    34

    Re: extract data from multiple columns and rows to make a single list

    Hi biex, I don't seem to be able to download the file.

  7. #7
    Registered User
    Join Date
    03-22-2020
    Location
    Malaysia
    MS-Off Ver
    2013 and 365 Pro Plus
    Posts
    56

    Re: extract data from multiple columns and rows to make a single list

    Quote Originally Posted by pvwebster View Post
    Hi biex, I don't seem to be able to download the file.
    try redownload it again... im not sure what happen... just in case download is not possible... respond here again and see what we can do to resolve it another way

    edit:

    Im not sure about the data on Room 1, because it have 2 bed... so i have edited my excel to include both bed in room 1 in each ward.

    if not is the case, please let me know and we see what we can do about it.
    Last edited by biex; 04-10-2020 at 09:36 AM.

  8. #8
    Registered User
    Join Date
    01-31-2012
    Location
    Australia
    MS-Off Ver
    OFFICE 365
    Posts
    34

    Re: extract data from multiple columns and rows to make a single list

    Thank you everyone, for your much-appreciated assistance. Before this post I naively thought I knew a bit about excel - I would have classified myself as an intermediate user. After looking at your responses, I realise now that I know very little and need to do a lot of work on my excel skills. I am trying to understand the formulas you have used and might need to seek your assistance if I can't fathom it out

    Thank you once again for all your help.

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: extract data from multiple columns and rows to make a single list

    You're welcome - thanks for the rep.

    We are all here to help, so feel free to post back with any further queries that you might have about the solutions offered.

    Pete

+ 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] how to extract multiple rows of data based on a single row value?
    By resiexfor in forum Excel General
    Replies: 10
    Last Post: 02-07-2020, 05:56 AM
  2. Replies: 3
    Last Post: 04-28-2017, 03:21 PM
  3. Re organizing data into multiple rows from a single row with multiple columns
    By FLS! in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2017, 05:10 PM
  4. Replies: 1
    Last Post: 04-06-2016, 07:02 AM
  5. Replies: 6
    Last Post: 02-19-2014, 10:25 AM
  6. Replies: 9
    Last Post: 12-15-2013, 10:05 PM
  7. Replies: 1
    Last Post: 03-18-2009, 04:18 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