VLOOKUP across sheets: A function that searches for a value in the first column of a table on another worksheet and returns a value in the same row from a specified column
Note: Syntax: =VLOOKUP(lookup_value, Sheet2!table_array, col_index_num, [range_lookup])
- Identify the lookup value in Sheet1
- Reference the table array in Sheet2 using "SheetName!" prefix
- Specify the column index in the Sheet2 table
- Use FALSE for exact match
Sheet1!A2 (Product ID)
Sheet2!$A$2:$B$10
2 (Price column)
=VLOOKUP(A2,Sheet2!$A$2:$B$10,2,FALSE)
The formula =VLOOKUP(A2,Sheet2!$A$2:$B$10,2,FALSE) retrieves the price from Sheet2 based on Product ID in Sheet1
• Sheet reference: Use "SheetName!" before range
• Absolute references: Use $ to lock table range
• Exact match: Use FALSE for precise matching
• Practice Tip: Name ranges for cleaner cross-sheet references
- =VLOOKUP(A1,Sheet2!A:B,2,FALSE) - Entire column reference
- =VLOOKUP(A1,'Sales Data'!$A$1:$D$100,3,FALSE) - Space in sheet name
- =IFERROR(VLOOKUP(A1,Sheet2!$A$1:$B$10,2,FALSE),"Not Found") - Error handling
- Always use absolute references for the lookup table
- Sheet names with spaces need single quotes: 'Sheet Name'
- Combine with IFERROR to handle missing values gracefully
Q: What if Sheet2 is in a different workbook?
A: Reference the workbook: =[Workbook.xlsx]Sheet2!$A$2:$B$10
Q: Can VLOOKUP pull data from right to left?
A: No, VLOOKUP only looks right. Use INDEX/MATCH for leftward lookups.
INDEX/MATCH across sheets: A flexible lookup combination that can retrieve data from any column or row in another worksheet
Note: Syntax: =INDEX(Sheet2!return_range, MATCH(lookup_value, Sheet2!lookup_range, 0))
- Identify the return range in Sheet2
- Identify the lookup range in Sheet2
- Define the lookup value in Sheet1
- Combine INDEX and MATCH with sheet references
Sheet2!C:C (Department column)
Sheet2!A:A (Employee ID column)
Sheet1!A2 (Employee ID)
=INDEX(Sheet2!C:C,MATCH(A2,Sheet2!A:A,0))
The formula =INDEX(Sheet2!C:C,MATCH(A2,Sheet2!A:A,0)) retrieves department from Sheet2 based on Employee ID in Sheet1
• Sheet reference: Prefix all ranges with "SheetName!"
• Flexibility: Can lookup in any direction unlike VLOOKUP
• Efficiency: More efficient with large datasets
• Practice Tip: Use 0 for exact match in MATCH function
- =INDEX(Sheet2!B:D,MATCH(A1,Sheet2!A:A,0),2) - Column offset
- =INDEX('Employee Data'!$C$2:$C$1000,MATCH(A1,'Employee Data'!$A$2:$A$1000,0)) - Named sheet
- =IFERROR(INDEX(...),"Not Found") - Error handling
- INDEX/MATCH is more flexible than VLOOKUP for cross-sheet lookups
- Can pull data from left-side columns (VLOOKUP cannot)
- Use entire column references (A:A) for dynamic ranges
Q: What's the advantage over VLOOKUP?
A: INDEX/MATCH can lookup in any direction and is more efficient with large datasets.
Q: How do I handle multiple matches?
A: MATCH returns the first match. For subsequent matches, use more complex array formulas.
SUMPRODUCT across sheets: Multiplies corresponding elements in arrays from different worksheets and sums the results
Note: Syntax: =SUMPRODUCT(--(Sheet1!range1=Sheet2!range2))
- Reference the first range in Sheet1
- Reference the second range in Sheet2
- Compare the ranges element-wise
- Convert TRUE/FALSE to 1/0 using double unary
- Sum the results
(Sheet1!A2:A5=Sheet2!A2:A5)
--(Sheet1!A2:A5=Sheet2!A2:A5)
=SUMPRODUCT(--(Sheet1!A2:A5=Sheet2!A2:A5))
The formula =SUMPRODUCT(--(Sheet1!A2:A5=Sheet2!A2:A5)) counts 3 matches between the two sheets
• Element-wise comparison: Creates array of TRUE/FALSE values
• Double unary: -- converts TRUE/FALSE to 1/0
• Array operation: No need for Ctrl+Shift+Enter
• Practice Tip: Ensure ranges are the same size for accurate comparison
- =SUMPRODUCT(--(Sheet1!A:A=Sheet2!A:A)) - Entire column comparison
- =SUMPRODUCT((Sheet1!A1:A10>Sheet2!A1:A10)*1) - Count where Sheet1 > Sheet2
- =SUMPRODUCT(--(Sheet1!A1:A10<>Sheet2!A1:A10)) - Count differences
- SUMPRODUCT is non-array and easier to use than traditional array formulas
- Works with both text and numeric comparisons
- Ensure both ranges have the same dimensions
Q: What if ranges have different sizes?
A: SUMPRODUCT will only compare up to the size of the smaller range.
Q: Can I compare multiple conditions?
A: Yes! Combine with multiplication: (Condition1)*(Condition2)
Cross-sheet conditional formatting: Applying formatting rules based on data in another worksheet
Note: Uses formulas with sheet references to determine which cells to format.
- Select the range in Sheet1 to format
- Go to Home > Conditional Formatting > New Rule
- Choose "Use a formula to determine which cells to format"
- Enter formula: =ISERROR(MATCH(A1,Sheet2!$A$1:$A$100,0))
- Set formatting options
Sheet1!A1:A100
Home > Conditional Formatting > New Rule
=ISERROR(MATCH(A1,Sheet2!$A$1:$A$100,0))
Set fill color for unmatched items
The formula =ISERROR(MATCH(A1,Sheet2!$A$1:$A$100,0)) highlights cells in Sheet1 that don't exist in Sheet2
• Formula approach: Use sheet references in conditional formatting formulas
• Relative references: Adjust for each cell in the range
• Absolute references: Lock lookup range with $
• Practice Tip: Test formula on single cell before applying to range
- =COUNTIF(Sheet2!$A$1:$A$100,A1)=0 - Alternative using COUNTIF
- =NOT(ISERROR(MATCH(A1,Sheet2!$A$1:$A$100,0))) - Highlight matches instead
- =A1<>Sheet2!A1 - Compare specific cells
- Use absolute references for lookup ranges
- Test formulas on single cells before applying to ranges
- Combine with data validation for comprehensive data management
Q: How do I remove cross-sheet conditional formatting?
A: Select range, Home > Conditional Formatting > Manage Rules > Delete Rule.
Q: Can I reference multiple sheets in one rule?
A: Yes, combine conditions with AND/OR functions.
COUNTIF across sheets: Counting occurrences of a value in a range on another worksheet
Note: Syntax: =COUNTIF(Sheet2!range, criteria)
- Reference the range in Sheet2
- Define the criteria (value to count)
- Use the COUNTIF function with sheet reference
- Compare with Sheet1's count if needed
Sheet2!A:A (Product column)
Sheet1!A2 (Product to count)
=COUNTIF(Sheet2!A:A,A2)
The formula =COUNTIF(Sheet2!A:A,A2) counts 3 occurrences of "Widget A" in Sheet2
• Sheet reference: Prefix range with "SheetName!"
• Criteria flexibility: Can be text, number, or cell reference
• Wildcards: Use * and ? for partial matches
• Practice Tip: Use COUNTIFS for multiple criteria across sheets
- =COUNTIF(Sheet2!A:A,">100") - Count values > 100
- =COUNTIF(Sheet2!A:A,A1&"*") - Count with wildcard
- =COUNTIFS(Sheet2!A:A,A1,Sheet2!B:B,">10") - Multiple criteria
- Use entire column references (A:A) for dynamic ranges
- Combine with other functions for complex comparisons
- Case-insensitive by default
Q: Can I count across multiple sheets?
A: Yes, add multiple COUNTIF functions: =COUNTIF(Sheet1!A:A,"X")+COUNTIF(Sheet2!A:A,"X").
Q: How do I count unique values across sheets?
A: Use advanced techniques with FREQUENCY or UNIQUE functions (Excel 365).