+ Reply to Thread
Results 1 to 14 of 14

Combine functions to return the right values from a matrix

  1. #1
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Question Combine functions to return the right values from a matrix

    Hello Everyone,

    I have a monthly calendar with all the staff for for every day of the month (MATRIX), and I need to put in formulated template (RETURN VALUES FROM THE MATRIX), just the staff working in one specific day, just changing the date of the template.

    The columns in the MATRIX: staff name, job position, shift, unit, and one column for each day of the month. If the employee doesn't work some day, I leave the cell blank; if they work that day, I type the unit code, and other codes could be included like vacation, holiday, leave of absence, or sick.

    What I expect in the section called "RETURN VALUES FROM THE MATRIX" is that, if I select a date on the cell assigned, all the staff for that day should be populated automatically on the specific area below, showing all other codes as well if there is someone on holiday, vacation, sick, etc, on that day.

    The functions I tried to combine initially were Index & Match but obviously doesn't work; I guess I have to combine Index & Aggregate, or Filter but at this point I'm stuck.

    I would really appreciate your help.

    Thank you so much in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Combine functions to return the right values from a matrix

    something like in n5
    =FILTER($E$5:$E$22,OFFSET(E5,0,MATCH(N4,F4:J4,0),18,1)=M6)

    but you will have to hard code the vacation holiday and sick

  3. #3
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Combine functions to return the right values from a matrix

    I did it as below and attached:

    2C, 4C, 3P, FLO:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I renamed your headings on the Vacation, Holiday & Sick tables to: HOL, VAC, Sick and used the below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If things don't change they stay the same

  4. #4
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Re: Combine functions to return the right values from a matrix

    Thank you so much davsth; I had to fix some files but it works. The only thing that I don't know how to fix now is that the number of rows with new employees can increasee; how can I make the height dynamic?

  5. #5
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Re: Combine functions to return the right values from a matrix

    Thank you so mnuch CheeseSandwich!! it works perfect!! Really appreciate your help on this matter. I have a question though, what if I convert the matrix in a table; everytime I add a new employee are the formulas being adjusted automatically? Again thank you so much for your help!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,467

    Re: Combine functions to return the right values from a matrix

    how can I make the height dynamic?

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Combine functions to return the right values from a matrix

    With the method below, it should update when the table is expanded:

    2C, 4C, 3P, FLO:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I renamed your headings on the Vacation, Holiday & Sick tables to: HOL, VAC, Sick and used the below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit: you may have to change the date format in the formula
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: Combine functions to return the right values from a matrix

    M6=transpose(unique(b5:b22))

    m7=iferror(filter($e$5:$e$100,(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))=m$6)*(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))>0)),"")

    r7=iferror(filter($e$5:$e$100,(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))=r$6)*(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))>0)),"")
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Re: Combine functions to return the right values from a matrix

    Thank you so much TMS!

  10. #10
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Re: Combine functions to return the right values from a matrix

    Thank you so much for the update CheeseSandwich; it works perfect! really appreciate your help!

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,467

    Re: Combine functions to return the right values from a matrix

    Thank you so much TMS!
    You're welcome.



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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  12. #12
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Re: Combine functions to return the right values from a matrix

    Ciao CARACALLA; grazie per la tua proposta! It is really a great idea for a different type of report. Thank you so much!
    I was thinking that could be very interesting to include another two filters following your idea.
    Would you mind to consider having three filters (Day, Shift, Position)?
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-30-2023
    Location
    New York
    MS-Off Ver
    0ffice 365
    Posts
    22

    Re: Combine functions to return the right values from a matrix

    Thank you so much TMS; I'm a new user and I didn't know about that. Thank you so much!

  14. #14
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: Combine functions to return the right values from a matrix

    M9=iferror(filter($e$5:$e$100,(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))=m$8)*(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))>0)*(index($b$5:$d$100,,match($m$5,$b$4:$d$4,0))=$n$5)*(index($b$5:$d$100,,match($m$6,$b$4:$d$4,0))=$n$6)),"")

    r9=iferror(filter($e$5:$e$100,(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))=r$8)*(index($f$5:$j$100,,match($n$4,$f$4:$j$4,0))>0)*(index($b$5:$d$100,,match($m$5,$b$4:$d$4,0))=$n$5)*(index($b$5:$d$100,,match($m$6,$b$4:$d$4,0))=$n$6)),"")
    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. Return values from a matrix table
    By hasan mougharbel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-29-2022, 07:34 PM
  2. Reverse matrix lookup - Return array of matching values in column
    By jjqq in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-21-2022, 04:09 PM
  3. return unique values from matrix; matching a criteria
    By nielsb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-01-2019, 11:59 PM
  4. [SOLVED] Return row number of complex matrix values
    By triangulo in forum Excel General
    Replies: 12
    Last Post: 10-30-2013, 08:03 AM
  5. Macro to combine and return values
    By meleo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2012, 09:59 PM
  6. Replies: 1
    Last Post: 11-24-2008, 10:13 AM
  7. [SOLVED] How to use an array or matrix to return text vs. numeric values
    By Ingrid in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-09-2005, 08:08 PM

Tags for this Thread

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