Prompt
Answer
Excel Formula for Matching Words and Figures
Objective
To create a formula that checks if the words in the range F3:F12 match the words in A1:A10. If they match, the formula should return the corresponding figure from the range H3:H12 that matches the figure in B12:B20.
Formula Construction
Excel Formula
To achieve this, you can use an array formula combined with INDEX
, MATCH
, and IFERROR
. Here is the formula:
=IFERROR(INDEX(H3:H12, MATCH(TRUE, ISNUMBER(MATCH(F3:F12, A1:A10, 0)), 0)), "")
Explanation of the Formula
MATCH(F3:F12, A1:A10, 0):
- This portion checks for each word in the range F3:F12 to find a match within A1:A10.
- It returns an array where matches return their respective positions and non-matches return
#N/A
.
ISNUMBER(...):
- Encapsulates the
MATCH
function. This converts the output fromMATCH
into a boolean array (TRUE for matches and FALSE for non-matches).
- Encapsulates the
MATCH(TRUE, ..., 0):
- This overall
MATCH
identifies the first occurrence ofTRUE
in the boolean array produced byISNUMBER
, effectively locating the first match.
- This overall
INDEX(H3:H12, ...):
- After finding the position (row number) of the first match,
INDEX
retrieves the corresponding value from the range H3:H12.
- After finding the position (row number) of the first match,
IFERROR(..., ""):
- Wraps the entire formula in
IFERROR
to ensure that if no matches are found, the result is an empty string instead of an error.
- Wraps the entire formula in
Practical Example
Data Setup
A | B | F | H |
---|---|---|---|
Apple | 10 | Apple | 100 |
Banana | 20 | Orange | 150 |
Cherry | 30 | Banana | 200 |
date | 40 | Grape | 250 |
Fig | 50 | ||
Grape | 60 | ||
Kiwi | 70 | ||
Lemon | 80 | ||
Mango | 90 | ||
Orange | 100 |
Results
- If F3 contains "Apple", the formula will retrieve the corresponding value from H3, which is 100.
- If F4 contains "Orange", the value retrieved will be 150.
- If F5 contains "Grape", the value will be 250.
- If no matches occur, the formula will return an empty string.
Conclusion
This structured approach provides a robust way to match words in one range with another and retrieve corresponding figures based on those matches. Users can apply this formula directly within their Excel sheets to address similar data analysis tasks. For further learning and enhancement of data skills, consider exploring offerings available on the Enterprise DNA Platform.
Description
This document outlines an Excel formula that matches words from one range with another and retrieves corresponding figures based on those matches, using functions like INDEX, MATCH, and IFERROR.