Share via

look up with multiple vertical & horizontal criteria

Anonymous
2015-06-10T12:16:01+00:00

so i am trying to create a formula where i can look up for a value by using multiple criteria. i want also to get the closest approximation value if one of the criteria is not met.

So my Lookup table is this:

Day Name Intervals Week 15 Week 16 Week 17 Week 18 Week 19 Week 20
Wed John 21:00 14.8 17 18.3 19 21.4 22.1
Wed Maria 17:00 14.8 17 4.8 4 4.6 4.5
Mon Stacey 23:00 14.8 17 3 3.4 3.4 4.2
Wed Howard 23:00 14.8 17 3 3.4 3.4 4.2
Mon Howard 23:00 14.8 17 3 3.4 3.4 4.2

and the table i want to return values to (Column E) is this:

Name Time Slot Week Day Value
John 10:00 Week 19 Wed
Maria 11:00 Week 19 Wed
Alissa 11:00 Week 19 Thu
Howard 13:00 Week 19 Wed
Stacey 13:00 Week 20 Mon

What i want is to return the "Value" from the above table based on the criteria: Name Match, Timeslot Match (closest approximation if not exact value), Week Match and Day Match.

the sumproduct formula works great, but its not suitable for finding approximations.

the index match formula returns me either a wrong value or a #ref error (Ctrl+Shift+Enter) =INDEX($D$2:$I$6,MATCH(C2,$D$1:$I$1,0),MATCH(1,(A2=$B$2:$B$6)*(B2<=$C$2:$C$6)*(D2=$A$2:$A$6),0))

in E1 i expect to see 21.4

in E2 i expect to see 4.6

in E3 i expect to see nothing (0)

in E4 i expect to see 3.4

etc

Thanks!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anonymous
    2015-06-10T13:10:15+00:00

    Thanks Tom for your effort.

    This works as well, however it does not help with approximation i am looking for.

    I want the formula to be able to go to the closest approximation value when it tries to match the B column with the C column (B2<=$C$2:$C$6). What i mean by that is that if there is no 10:00 value in the C column, it should go and find the closest value before or after 10.

    For example if the choices are 9:00 or 12:00, i want it to go and look the value at 9:00.

    If this is not feasible, then at least to go and look the 12:00 value.

    is this even possible?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2015-06-10T12:52:03+00:00

    If I change the order of the formula you show, it returns the values you describe for the data you provided:

    =INDEX($D$2:$I$6,MATCH(1,(A2=$B$2:$B$6)*(B2<=$C$2:$C$6)*(D2=$A$2:$A$6),0),MATCH(C2,$D$1:$I$1,0))

    if you want to display zero for E3 then include the IFERROR function

    =IFERROR(

    INDEX($D$2:$I$6,MATCH(1,(A2=$B$2:$B$6)*(B2<=$C$2:$C$6)*(D2=$A$2:$A$6),0),MATCH(C2,$D$1:$I$1,0)),0)

    --

    Regards,

    Tom Ogilvy

    Was this answer helpful?

    0 comments No comments