Fix an Excel LOOKUP Formula Referencing Another Worksheet
Question details
The user needs an Excel LOOKUP formula to retain references to ranges on another worksheet.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A LOOKUP formula uses COUNTIF ranges on a worksheet named Input to find a value that has not appeared in earlier output cells.
- Observed behavior
- References such as Input!$A$2:$A$200 are reportedly removed or deactivated.
Confirm that the source worksheet is named Input and that its values are in A2:A200. The example formula assumes you will enter it in A2 on a different worksheet, with A1 as the cell above the first result.
Enter the LOOKUP formula in a worksheet cell
Use this approach to check the cross-sheet syntax and avoid entering the formula in a feature that may restrict range references.
On a worksheet other than Input, select cell A2. The formula uses $A$1:A1 to check the cells above the result.
In the formula bar, enter =LOOKUP(2,1/((COUNTIF($A$1:A1,Input!$A$2:$A$200)=0)*(COUNTIF(Input!$A$2:$A$200,Input!$A$2:$A$200)>0.5)),Input!$A$2:$A$200) and press Enter.
Select the result cell and inspect the formula bar. If the source sheet has spaces or special characters in its name, enclose the name in single quotes, for example 'Input Data'!$A$2:$A$200.
Drag the fill handle down column A to check each new result against the preceding output cells. If you place the formula elsewhere, adjust $A$1:A1 to refer to the output cells above it.

Check where the cross-sheet formula is being used
Use this check if the reference changes when you enter the formula in a rule, validation setting, or other Excel feature rather than a cell.
Use WPS Spreadsheets for a Cross-Sheet LOOKUP
Open your workbook in WPS Spreadsheets and enter a LOOKUP formula that checks values on an Input worksheet against earlier results.
- 1. Open the workbook: In WPS Spreadsheets, select Open and choose your Excel workbook.
- 2. Check the source sheet: Select the Input sheet tab and confirm that the source values are in A2:A200.
- 3. Enter the formula: On another sheet, select A2 and enter =LOOKUP(2,1/((COUNTIF($A$1:A1,Input!$A$2:$A$200)=0)*(COUNTIF(Input!$A$2:$A$200,Input!$A$2:$A$200)>0.5)),Input!$A$2:$A$200) in the formula bar.
- 4. Check and fill the results: Press Enter, inspect the result, and drag the fill handle down column A if you need additional values.

Frequently Asked Questions
How do I reference a sheet name with spaces?
Enclose the sheet name in single quotes before the exclamation mark, as in 'Input Data'!$A$2:$A$200. Update every occurrence of the sheet reference in the formula.
Why does the formula return #N/A?
LOOKUP can return #N/A when no source value qualifies. Check the Input range and the output cells above the formula to see whether the available values have already been listed.
Does this formula return the first unmatched value?
No. This LOOKUP construction returns the last qualifying value in the Input range.
Why does $A$1:A1 change when I fill the formula down?
The first reference is fixed, while the second is relative. As you drag the fill handle down, the range expands to include the preceding output cells.




