Function Problems

Excel IF Formula to Return a Value From Another Cell

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

The user needs a formula that checks a name and returns a related value from another cell.

How to Use an Excel IF Formula to Return a 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.
Before you start

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.

Solution 1Recommended

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.

1
Select a result cell

In Excel, click the cell where you want the result, such as C2.

2
Enter the IF formula

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.

3
Apply it to other rows

Drag the fill handle from C2 down the column to test the corresponding cells in additional rows.

Use IF to Return a Value for One Name
When the name does not match: The empty quotation marks make the formula return an empty string. Replace them with text such as "Not found" if you prefer a visible result.
Work with formulas in WPS Spreadsheets

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. 1. Open the workbook: In WPS Spreadsheets, open the workbook containing the names and values.
  2. 2. Select the result cell: Click an empty cell, such as C2, where you want the returned value to appear.
  3. 3. Enter the formula: Type =IF(A2="Name",B2,"") and press Enter. Change the name and cell references to match your worksheet.
  4. 4. Copy the formula: Drag the fill handle down from the result cell to apply the formula to additional rows.
Return a value from another cell when a name matchesFill formulas down to check additional rowsOpen and edit Microsoft Excel XLSX and XLS filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.