How do you use INDEX and MATCH together to get the value in column C for a row where…
- User
How do you use INDEX and MATCH together to get the value in column C for a row where column A equals “Apples”? Use a one-line formula.
Assistant
To use
INDEXandMATCHtogether to get the value in column C for a row where column A equals "Apples," you can use the following one-line formula:=INDEX(C:C, MATCH("Apples", A:A, 0))Here's how it works:
MATCH("Apples", A:A, 0)finds the row number where "Apples" is located in column A.INDEX(C:C, ...)returns the value from column C at the row number found byMATCH.
This formula assumes that "Apples" appears exactly once in column A. If "Apples" can appear multiple times and you want the first occurrence, this formula will work as intended. If you need to handle multiple occurrences differently, you might need a more complex formula or additional logic.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.