+ Reply to Thread
Results 1 to 6 of 6

Trying to create spreadsheet that uses 3 different criteria to return a value

  1. #1
    Registered User
    Join Date
    05-21-2022
    Location
    Texas
    MS-Off Ver
    Microsoft 365
    Posts
    3

    Trying to create spreadsheet that uses 3 different criteria to return a value

    Hello,

    I work for a fire dept that allows us to put in for stations based off seniority and then class rank if seniority date is the same. We are able to pick up to 6 spots. If my first choice is selected by someone with more seniority, then it will look at my 2nd choice. I am able to download the entire transfer request as soon as the transfer is closed. I want to be able to copy and paste the transfer into an excel spreadsheet and have it fill in the results for me. Also, some stations might have multiple spots open. I sort the list by seniority date and then class rank. Right now I have to manually go through the list and then delete the stations as I go to do it. For instance:

    Payroll Station Shift Vehicle Choice Available Stations
    12 38 A Apparatus 1 38 A Apparatus
    12 38 C Apparatus 2 38 C Apparatus
    12 62 C Apparatus 3 38 C Apparatus
    12 38 D Apparatus 4 38 D Apparatus
    13 38 A Apparatus 1 62 C Apparatus
    13 38 C Apparatus 2
    13 62 C Apparatus 3
    13 38 D Apparatus 4
    14 38 A Apparatus 1
    14 38 C Apparatus 2
    14 62 C Apparatus 3
    14 38 D Apparatus 4
    15 38 A Apparatus 1
    15 38 C Apparatus 2
    15 62 C Apparatus 3
    15 38 D Apparatus 4

    Thank you for the help.

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

    Re: Trying to create spreadsheet that uses 3 different criteria to return a value

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-21-2022
    Location
    Texas
    MS-Off Ver
    Microsoft 365
    Posts
    3

    Re: Trying to create spreadsheet that uses 3 different criteria to return a value

    Thanks AliGW,

    Please see attached sample, at least I think I did it right.

    The data on the left side of the screen are the choices the firefighters put in for with their seniority date and class rank. I have them in order of seniority date and class rank. The info at the top right are the available stations the firefighters can choose from. The bottom right column is was the result of the posting should be with the correct formula.
    Attached Files Attached Files
    Last edited by Sugarbox; 05-21-2022 at 05:03 PM. Reason: Clarification

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

    Re: Trying to create spreadsheet that uses 3 different criteria to return a value

    I am confused as to why payroll 13 was given 38 C when the first choice (cell G8) appears to be 62 C which is open and not selected by payroll 12.
    Also confused that payroll 13 has two class ranks (6 and 48).
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    05-21-2022
    Location
    Texas
    MS-Off Ver
    Microsoft 365
    Posts
    3

    Re: Trying to create spreadsheet that uses 3 different criteria to return a value

    Hey JeteMc,

    You are correct. I messed up the sample I attached. Sorry about that. I have corrected the spreadsheet and attached. Hopefully when looking at now it makes more sense. All payrolls should have same seniority date but each one has a different class rank. Each payroll should have only 4 choices shown.
    Attached Files Attached Files

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

    Re: Trying to create spreadsheet that uses 3 different criteria to return a value

    This proposal employs helper columns (K:O) which may be moved and/or hidden for aesthetic purposes.
    1. The column headers displaying station and shift are populated using: =INDEX($S3:$S7,COLUMNS($K1:K1))
    2. Rows 4:19 calculate the assignments using: =AND(K$1=$C4,K$2=$D4,SUM(K$3:K3)=0,SUM($J4:J4)=0,SUMPRODUCT(($K$3:$O3)*($A$3:$A3=$A4))=0)+0
    3. The results are given in T18:U21 using: =INDEX(C$4:C$19,AGGREGATE(15,6,(ROW(C$4:C$19)-ROW(C$3))/($A$4:$A$19=$S18)/($K$4:$O$19=1),1))
    Let us know if you have any questions.

+ 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] Return Values from Spreadsheet based on 2 criteria
    By aksaunders in forum Excel General
    Replies: 4
    Last Post: 09-30-2021, 03:02 PM
  2. Replies: 0
    Last Post: 04-29-2019, 11:00 AM
  3. [SOLVED] Macro- Search multiple criteria in spreadsheet return with multiple results in new sheet
    By nicebeaches in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2018, 04:47 PM
  4. Replies: 0
    Last Post: 09-08-2017, 09:31 AM
  5. Replies: 4
    Last Post: 01-12-2014, 11:52 PM
  6. Replies: 0
    Last Post: 02-16-2013, 07:33 AM
  7. Replies: 4
    Last Post: 12-24-2012, 12:21 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