How to Use an IF Formula to Pull Values from Another Worksheet
Question details
The user needs to conditionally display data from a source worksheet onto a main worksheet based on a specific control cell's numerical value.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Consolidating specific text and subtotals on a main summary worksheet only when a designated control cell on a separate worksheet (e.g., a room sheet) equals 1.
- Observed behavior
- Requires a formula that dynamically displays specific values when the condition is met and leaves the destination row completely blank when the control value is 0.
Ensure that the worksheet names referenced in your formula exactly match the actual sheet names in your workbook, paying special attention to spaces and punctuation.
Use the IF Function with Cross-Sheet References
Create a conditional IF formula that targets the control cell on the source worksheet to determine what data to display in the main worksheet.
The IF function can seamlessly evaluate conditions on a different worksheet. When referencing another sheet, the sheet name must be followed by an exclamation mark (!). If the sheet name contains spaces, it must be enclosed in single quotation marks.
Click on the cell in your Main worksheet where you want the room name or subtotal to appear.
Type the formula to check the condition. For example, to display 'Dining Room' when cell C4 on the Dining Room sheet is 1, enter: =IF('Dining Room'!C4=1, "Dining Room", "")
To pull a related subtotal instead of fixed text, replace the true value with the cell reference. For example: =IF('Dining Room'!C4=1, 'Dining Room'!D15, "")
Press Enter to apply the formula. You can then drag the fill handle to copy the formula to adjacent cells, updating the cell references as needed.

Easily Manage Cross-Sheet Formulas with WPS Spreadsheet
WPS Spreadsheet offers robust formula support, including intelligent cross-sheet referencing, nested IF statements, and auto-complete features that make building complex logic simple and intuitive.
- 1. Open your Workbook: Launch WPS Spreadsheet and open the file containing your multiple worksheets.
- 2. Start the Formula: Select the target cell on your main sheet and type =IF( to trigger the formula builder.
- 3. Select the Source Cell: Use your mouse to click on the source worksheet tab, then click the control cell to automatically generate the correct cross-sheet reference.
- 4. Complete the Logic: Finish the formula by typing =1, your desired output value, and "" for a blank result, then press Enter.

Frequently Asked Questions
Why is my IF formula returning an error when pulling from another sheet?
This usually happens if the worksheet name contains spaces but isn't enclosed in single quotes. Ensure your reference looks like 'Dining Room'!C4 instead of Dining Room!C4.
How do I pull a cell's value instead of typed text if the condition is true?
Replace the text string in the IF formula with the cell reference you want to pull. For example, use =IF('Sheet1'!A1=1, 'Sheet1'!B1, "") to pull the value from B1.
Why does my formula not recognize the number 1 in the control cell?
If you wrapped the number in quotation marks (e.g., "1") in your formula, the spreadsheet treats it as text. Remove the quotes so the formula correctly recognizes the numerical value in the control cell.
How can I check multiple control cells across different sheets at once?
You can use nested IF functions, or combine the IF function with logical functions like AND or OR to evaluate multiple control cells before returning a value.




