Forum Discussion

Brenda Hines's avatar
Brenda Hines
Copper Contributor
Aug 23, 2017

VLOOKUP help required

I am not sure whether to use nested VLOOKUPs or MATCH/INDEX and VLOOKUP to implement what I’m trying to do.

 

On the main worksheet I have populated the Project Category using VLOOKUP based on the project lifecycle entered by the user. =VLOOKUP(H4,Category,2,FALSE) – this works fine and is using Lookup table 1.

 

On the main worksheet, the user will enter in a score for each of the Project Elements (ranging from 1- unacceptable to 5-excellent).

 

What I need to do is – based on the Category, apply the appropriate Weighting factor to the Project Element Scores (lookup table 3) and output that value into another column (called Project Element Weighted Score).

 

Lookup table 1:

 

Lifecycle

Category

1-Investigation

1-Conceive

2-Definition

2-Design

3-Implementation

3-Build

4-Production

3-Build

5-Frozen

4-Manage

6-Phase out Started

4-Manage

7-Phased out

4-Manage

 

Lookup table 2:

Category

Project Elements

Score

Output value

weighting

1-Conceive

Personnel

5

5

1

1-Conceive

Personnel

4

4

 

1-Conceive

Personnel

3

3

 

1-Conceive

Personnel

2

2

 

1-Conceive

Personnel

1

1

 

1-Conceive

R&D

5

5

5

1-Conceive

R&D

4

4

 

1-Conceive

R&D

3

3

 

1-Conceive

R&D

2

2

 

1-Conceive

R&D

1

1

 

1-Conceive

Infrastructure

5

5

2

 

I have in the weighted score field on the main spreadsheet and a VLOOKUP formula that was working prior to introducing the Weighting by Category concept. I can’t figure out how to include a lookup to to get the category and the corresponding weighting factor and use the correct weighting factor to apply to the score. 

 

I hope I’ve been clear enough - I cannot send my spreadsheet as it has c

3 Replies

  • GhulamMujtaba's avatar
    GhulamMujtaba
    Copper Contributor

    You're dealing with a multi-criteria lookup, which is a common challenge in Excel. Let me help you understand your options.

    The Problem

    You need to look up a value based on three criteria:

    1. Category (from the Project Lifecycle)
    2. Project Element (e.g., Personnel, R&D, Infrastructure)
    3. Score (1-5)

    Then apply the appropriate weighting factor to calculate a weighted score.

    Recommended Solution: INDEX/MATCH with Multiple Criteria

    For multi-criteria lookups, INDEX/MATCH (or the newer XLOOKUP if you have Microsoft 365) is more flexible than nested VLOOKUPs.

    Option 1: INDEX/MATCH with Array Formula

    Assuming your Lookup Table 2 is in a range where:

    • Column A = Category
    • Column B = Project Element
    • Column C = Score
    • Column D = Output Value
    • Column E = Weighting

    excel

    =INDEX(WeightingColumn, MATCH(1, (CategoryColumn=YourCategory)*(ElementColumn=YourElement)*(ScoreColumn=YourScore), 0))

    Example (adjust cell references to your actual layout):

    excel

    =INDEX($E$2:$E$100, MATCH(1, ($A$2:$A$100=CategoryCell)*($B$2:$B$100=ElementCell)*($C$2:$C$100=ScoreCell), 0))

    Note: In older Excel versions, press Ctrl+Shift+Enter to enter this as an array formula. In Excel 365/2019+, just press Enter.

    Option 2: SUMPRODUCT (No Array Entry Needed)

    excel

    =SUMPRODUCT(($A$2:$A$100=CategoryCell)*($B$2:$B$100=ElementCell)*($C$2:$C$100=ScoreCell)*($E$2:$E$100))

    Option 3: XLOOKUP with Concatenation (Excel 365/2019+)

    Create a helper column in your lookup table that concatenates Category + Element + Score, then use:

    excel

    =XLOOKUP(CategoryCell&ElementCell&ScoreCell, HelperColumn, WeightingColumn, "Not Found")

    Calculating the Weighted Score

    Once you retrieve the weighting factor, multiply it by the score:

    excel

    =ScoreCell * [Weighting Formula from above]

    Or combine it all in one formula:

    excel

    =ScoreCell * INDEX($E$2:$E$100, MATCH(1, ($A$2:$A$100=CategoryCell)*($B$2:$B$100=ElementCell)*($C$2:$C$100=ScoreCell), 0))

    Quick Comparison

    MethodProsCons
    INDEX/MATCHFlexible, handles multiple criteriaSlightly complex syntax
    SUMPRODUCTNo Ctrl+Shift+Enter neededReturns 0 if no match (not an error)
    XLOOKUPClean syntax, easy to readOnly available in newer Excel
    Nested VLOOKUPFamiliarGets messy with 3+ criteria, less efficient

    My Recommendation

    Use INDEX/MATCH with multiple criteria — it's the most robust solution for your scenario and works across most Excel versions.

  • Try SUMPRODUCT

     

    = D4 * SUMPRODUCT(
       (Table3[Category]=$H$4) *
       (Table3[ProjectElement]=$C4) *
       (Table3[weighting])
    )

    Or INDEX/MATCH:

    = D4 *
      INDEX(
        Table3[weighting],
        MATCH(
          1,
          INDEX(
            (Table3[Category]=$H$4) *
            (Table3[ProjectElement]=$C4),
          0),
        0)
      )

     

Resources