Excel IF Formula to Return a Value From Another Cell
Question details
The user needs a formula that checks a name and returns a related value from another cell.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains names and related values, and the user wants to return a value when a name matches a condition.
- Observed behavior
- The desired result is a related cell value for a matching name and a blank when there is no match.
Identify the cell containing the name and the cell or range containing the values you want to return. For multiple names, arrange the names and their corresponding values in aligned rows.
Use IF to Return a Value for One Name
Use this formula when you need to test one name and return a value from the same row.
In Excel, click the cell where you want the result, such as C2.
Type =IF(A2="Name",B2,"") and press Enter. Replace Name with the text to match, A2 with the name cell, and B2 with the cell containing the value to return.
Drag the fill handle from C2 down the column to test the corresponding cells in additional rows.

Look Up Values for Multiple Names With INDEX and MATCH
Use a lookup table when several names have different associated values.
Return a Cell Value With IF in WPS Spreadsheets
Use an IF formula in WPS Spreadsheets to check a name and return a related value from another cell.
- 1. Open the workbook: In WPS Spreadsheets, open the workbook containing the names and values.
- 2. Select the result cell: Click an empty cell, such as C2, where you want the returned value to appear.
- 3. Enter the formula: Type =IF(A2="Name",B2,"") and press Enter. Change the name and cell references to match your worksheet.
- 4. Copy the formula: Drag the fill handle down from the result cell to apply the formula to additional rows.

Frequently Asked Questions
How do I return text instead of a value from another cell?
Put the text in quotation marks in the value-if-true argument. For example, =IF(A2="Name","Approved","") returns Approved when A2 matches Name.
How can I return values for several different names?
Create a table of names and values, then use a lookup formula such as =IFERROR(INDEX($E$2:$E$5,MATCH(A2,$D$2:$D$5,0)),""). Adjust the ranges to fit your table.
Can I use XLOOKUP instead of INDEX and MATCH?
Yes, if your Excel version supports XLOOKUP. For example, =XLOOKUP(A2,D2:D5,E2:E5,"") returns the corresponding value or an empty string if the name is not found.
Why does the formula return a blank?
The IF formula returns a blank when the name does not match. Check the spelling and extra spaces in the name cell, and confirm that the formula refers to the intended cells.




