Excel Practice Test

โ–ถ

Comparing two columns in Excel sounds easy. Open the sheet, eyeball the values, done. Then someone hands you a worksheet with 50,000 rows of customer data and asks which 12 entries changed overnight. Scrolling is no longer an option. The fastest path is a formula or a built-in shortcut, and Excel ships with at least seven of them. Each one fits a slightly different job.

This guide walks through every method with worked examples, real workflows, and the gotchas that catch first-timers. By the end you should know exactly which technique to reach for, how to debug the silent failures that drive analysts to drink, and how to scale the same logic up to a million rows with Power Query when formulas finally run out of steam.

The methods covered here also appear on most Excel certification exams and analyst job tests, so reading doubles as prep. If you handle weekly payroll checks, monthly inventory reconciliation, or one-off vendor cleanups, these seven techniques cover roughly ninety-five percent of every comparison task you will ever see. Bookmark this page and refer back when the next variation lands on your desk.

Why Column Comparison Matters

7
Comparison methods covered
3s
Time to compare 10k rows with formulas
0
VBA or add-ins required
100%
Works in Excel 2016 through 365

Start with the simplest comparison: the IF formula. Type =IF(A2=B2,"Match","No Match") into cell C2, then drag the fill handle to the bottom. Excel checks each row and writes a label next to it. This works great for two columns that should be identical row by row โ€” payroll IDs versus HR records, or product SKUs versus warehouse inventory counts.

The catch? IF only spots row-by-row mismatches. If the value in row 7 of column A appears down in row 19 of column B, IF will not flag the relationship. The function also treats text and numbers differently, so if one column stores IDs as text and the other stores them as real numbers, every comparison fails silently. For values that float around the list, switch to VLOOKUP instead โ€” it scans the whole range.

The 7 Methods to Compare Two Columns

๐Ÿ”ด IF Formula

Best for row-by-row equality checks. Returns Match or No Match in a third column.

๐ŸŸ  VLOOKUP

Finds whether values in column A exist anywhere in column B. Returns the matched value or #N/A.

๐ŸŸก MATCH + ISNUMBER

Faster than VLOOKUP for existence checks. Returns TRUE if found, FALSE otherwise.

๐ŸŸข Conditional Formatting

Visual highlighting in green or red. No formula column needed for the sweep.

๐Ÿ”ต EXACT Function

Case-sensitive comparison. Treats Apple and apple as different values.

๐ŸŸฃ COUNTIF

Counts how many times each value in column A appears in column B.

๐Ÿฉต Ctrl+\ Shortcut

Built-in Row Differences shortcut highlights row-by-row mismatches in one second.

VLOOKUP is the workhorse for existence checks across an entire range. Type =VLOOKUP(A2,$B$2:$B$1000,1,FALSE) โ€” it searches column B for the value in A2 and returns it if found, or #N/A if not. Wrap it in IFERROR to clean up the output: =IFERROR(VLOOKUP(A2,$B$2:$B$1000,1,FALSE),"Missing"). The dollar signs lock the lookup range when you drag the formula down the column.

VLOOKUP only searches left-to-right inside the lookup table, which trips up beginners. For two-way lookups, switch to INDEX MATCH or XLOOKUP. The fourth argument matters too โ€” passing FALSE forces exact matching, while TRUE does an approximate match that can return wrong results on unsorted data. Always pass FALSE unless you specifically need range-based lookups like tax brackets. For a deeper walkthrough, see the VLOOKUP guide.

Choose the Right Method for Your Goal

๐Ÿ“‹ Find Matches

Use IF for row-by-row pairs. Use VLOOKUP or MATCH+ISNUMBER when values can sit anywhere in the other column. Highlight matches with conditional formatting if you want a visual sweep without an extra column.

๐Ÿ“‹ Find Differences

Wrap IF around the not-equal operator: =IF(A2<>B2,"Different",""). For values missing from column B, use =IF(ISNA(VLOOKUP(A2,$B$2:$B$1000,1,FALSE)),"Only in A",""). Reverse the columns to find values only in B.

๐Ÿ“‹ Find Duplicates

COUNTIF is your friend: =COUNTIF($B$2:$B$1000,A2)>0 returns TRUE for any value in column A that exists in column B. Sum the TRUE results to count total overlap across both lists.

๐Ÿ“‹ Case-Sensitive

VLOOKUP and IF treat text as case-insensitive. To compare APPLE and apple as different values, use =EXACT(A2,B2) โ€” it returns TRUE only when the strings match character-for-character including capitalization.

Conditional formatting compares two columns without adding a third one. Select both columns, open Home then Conditional Formatting then New Rule, and pick "Use a formula to determine which cells to format." Type =$A1<>$B1 and choose a red fill. Excel paints every row where the values differ. Swap the operator to =$A1=$B1 for matching rows in green. The trick is the absolute column reference paired with a relative row reference โ€” that pattern walks the rule down the dataset correctly.

Conditional formatting shines during live meetings and client demos because the result appears instantly without an extra column cluttering the page. You can also stack rules โ€” one for matches, one for differences, one for duplicates โ€” and Excel evaluates them in order. The deeper how-to lives on the conditional formatting guide.

Be aware that conditional formatting on huge ranges (above 200,000 cells) can slow worksheet recalculation. If your file feels sluggish, convert the formatting rules into a helper column instead. To audit existing rules, go to Home then Conditional Formatting then Manage Rules. The dialog lists every rule applied so you can review, edit, or delete them in one place. Useful when you inherit a workbook from another analyst and want to see what is already running.

The number one reason comparison formulas return No Match when both cells look identical? Trailing spaces. Excel sees "apple" and "apple " as different strings. Wrap your comparison in TRIM: =IF(TRIM(A2)=TRIM(B2),"Match","No Match"). Same goes for non-printing characters that arrive with CSV imports โ€” use CLEAN to strip those. If you import data from web pages, run both functions: =TRIM(CLEAN(A2)).

MATCH paired with ISNUMBER is the speed champion for existence checks on big datasets. Type =ISNUMBER(MATCH(A2,$B$2:$B$1000,0)) โ€” MATCH returns a position number if found or #N/A if not, and ISNUMBER converts that to TRUE or FALSE. The zero argument forces exact matching rather than the approximate match that catches people out.

For datasets above 100,000 rows, MATCH outruns VLOOKUP by roughly 30% because it only scans a single column instead of the full table width. COUNTIF takes a different angle: =COUNTIF($B$2:$B$1000,A2) counts how many times the value appears. Zero means missing. Greater than one means duplicates exist. Both are core Excel function knowledge for any analyst role.

Before You Compare 2 Columns

Confirm both columns hold the same data type โ€” text vs number
Strip trailing spaces with TRIM if you imported from CSV or web
Use CLEAN to remove non-printing characters
Decide whether you need row-by-row or any-position matching
Lock lookup ranges with dollar signs ($B$2:$B$1000) before dragging
Wrap VLOOKUP in IFERROR to replace #N/A with a friendly message
Use EXACT when upper versus lower case matters
Test on 5 rows before applying to 50,000

EXACT is the function nobody teaches but every accountant needs. =EXACT(A2,B2) returns TRUE only when both cells match character-for-character โ€” including capitalization, spaces, and invisible characters. Use it when you compare password lists, product codes with case-sensitive identifiers, or anything where case carries meaning. The EXACT and MATCH combination handles case-sensitive lookups too.

Pair EXACT with SUMPRODUCT for case-sensitive lookups: =SUMPRODUCT(--EXACT(A2,$B$2:$B$1000)) returns a count of exact matches. EXACT works in every Excel version going back to 2003, so you can ship it to clients still on legacy systems. The function also accepts cell references on both sides, so you can compare an input cell to a long list of valid codes without rewriting the formula each time.

Strengths and Weaknesses of Each Method

Pros

  • Formulas update automatically when source data changes
  • Methods scale from 10 rows to a million without slowdown
  • No VBA or add-ins required for any approach
  • Visual conditional formatting needs no extra column
  • Built-in keyboard shortcuts solve simple cases instantly

Cons

  • VLOOKUP only searches left-to-right inside lookup tables
  • IF only catches row-by-row mismatches, not list-wide overlap
  • Hidden whitespace and data-type mismatches cause silent failures
  • Conditional formatting on huge ranges can slow recalc
  • XLOOKUP requires Excel 365 or 2021 โ€” older versions show errors

The keyboard shortcut nobody knows is Ctrl+\. Select both columns, press the combination, and Excel instantly highlights every cell in the second column that does not match the cell to its left. No formula. No conditional formatting rule. Just an instant visual answer in under a second. Apply a quick fill color and you have a permanent record of the mismatches.

The shortcut runs Go To Special under the hood. You can reach the same feature from Find and Select on the Home tab, then choose Row Differences. It only works on the row-by-row case, but for that case it has no equal. Keep this in your back pocket for quick audits, especially when someone hands you two columns of numbers and asks where the discrepancies are. Five seconds later, they have a highlighted answer.

Take the Free Excel Practice Test

INDEX MATCH is the comparison combo that bridges legacy Excel and modern XLOOKUP. The pattern looks like =INDEX($B$2:$B$1000,MATCH(A2,$B$2:$B$1000,0)) and returns the matched value from column B or #N/A if no match exists. It runs in Excel 2003 through 2024 and beats VLOOKUP on speed because MATCH evaluates only the lookup column instead of scanning the entire table width.

Many finance teams still standardize on INDEX MATCH for spreadsheets that travel between offices on different Excel versions. The syntax feels backwards at first, but after writing it three times the muscle memory locks in. The combination also supports two-dimensional lookups by passing MATCH formulas to both the row and column arguments of INDEX, which gives you a cross-tab pivot without learning new functions.

Speed Tips for Large Datasets

Manual
Switch calc mode for 100k+ rows
F9
Press to recalculate on demand
5s
Target recalc time for 1M rows
INDIRECT
Avoid this volatile function

Here is how a payroll analyst compares two columns in practice. Column A holds employee IDs from the HR system. Column B holds employee IDs from the timekeeping system. The analyst types =IF(ISNUMBER(MATCH(A2,$B$2:$B$5000,0)),"In Both","HR Only") in column C, then runs the reverse check in column D to find timekeeping-only entries.

Five minutes of formula work catches every termination that did not propagate between systems. The same pattern handles inventory reconciliation, vendor cleanup, student enrollment audits, and accounts receivable matching. The key is naming the columns clearly so the next analyst reads the logic without asking questions.

Adding a comment in cell C1 like "In Both = matched, HR separation status" turns a one-off task into a reusable template the whole team can run. Better yet, save the comparison file as an Excel template (.xltx) so opening it produces a fresh copy every time without overwriting the original. Templates encode tribal knowledge into reusable assets, which scales your impact far beyond your own desk.

Troubleshooting Comparison Bugs

Click each cell โ€” leading apostrophes turn numbers into text
Check alignment: numbers right-align, text left-aligns
Use ISTEXT and ISNUMBER to confirm data types programmatically
Open Formulas then Evaluate Formula to step through the calculation
Replace range references with named ranges to rule out off-by-one errors
Test the formula on three known matches before trusting the whole column

SUMPRODUCT handles comparisons that other functions cannot. Want to count rows where column A is greater than column B? Type =SUMPRODUCT((A2:A1000>B2:B1000)*1). Want a case-sensitive match count across two columns? Use =SUMPRODUCT(--EXACT(A2:A1000,B2:B1000)). The double-negative converts TRUE/FALSE to 1/0 so SUMPRODUCT can add them up.

This single function replaces what used to require array formulas with Ctrl+Shift+Enter. It works in every Excel version and never volatilizes, meaning your worksheet stays fast. Audit teams lean on SUMPRODUCT for batch reconciliation work because the formulas read clearly during a peer review. Once you understand the array-multiplication concept, the same pattern handles count-where-both-true, count-where-either-true, and weighted-average calculations.

Error Handling Functions for Cleaner Reports

๐Ÿ”ด IFERROR

Catches every error type. Replaces #N/A, #VALUE!, #DIV/0! with your chosen text.

๐ŸŸ  IFNA

Targets only #N/A errors. Leaves other errors visible during development.

๐ŸŸก ISERROR

Returns TRUE for any error. Pair with IF for conditional error handling.

๐ŸŸข ISNA

Returns TRUE only when the cell contains #N/A. More specific than ISERROR.

Power Query lifts comparison work to the next level when datasets exceed worksheet size. Load both columns as queries via Data then Get Data, then use Merge Queries to join them with a left outer, right outer, inner, left anti, or right anti join. Left anti returns values only in column A. Inner returns matches in both. The dropdown picks the join type with a single click.

The transformations run in the background and refresh with a single click when source data updates. For analysts moving from manual VLOOKUP work to repeatable pipelines, Power Query is the bridge. It ships free with every Excel install since 2016 and uses the same engine that powers Power BI. Once your query is set up, scheduling a daily refresh through Power Automate turns the entire comparison into a hands-off process.

Keyboard shortcuts shave minutes off every comparison task. F4 toggles absolute references โ€” press it after typing $B$2 to cycle through $B$2, B$2, $B2, and B2. Ctrl+Shift+End selects from the current cell to the bottom-right corner of your data. Ctrl+D fills down a formula instantly without dragging the corner.

Alt+H, L, N opens conditional formatting in three keystrokes. Pros never touch the mouse during a comparison job. Learning ten shortcuts deeply matters more than knowing fifty shallowly. Build muscle memory by forcing yourself to use shortcuts for a full week โ€” your speed roughly doubles by day seven. Print a one-page cheat sheet and pin it next to your monitor until the keystrokes become automatic.

Practice Excel Formulas Now

Sometimes the two columns you need to compare live on different sheets or different workbooks. Cross-sheet references look like =IF(Sheet1!A2=Sheet2!A2,"Match","No Match"). Cross-workbook references look like =VLOOKUP(A2,'[Other.xlsx]Sheet1'!$A:$A,1,FALSE) with the file name wrapped in square brackets.

Cross-workbook formulas only update when both files are open, so for daily reports either consolidate the data first with Power Query or keep both workbooks in the same OneDrive folder for automatic refresh. External links break easily when files move, so always document the source location at the top of your worksheet. A short note like "Source: Q3-payroll.xlsx, refreshed every Monday" saves the next analyst from chasing broken references for an hour.

Common Comparison Mistakes by the Numbers

73%
Of comparison bugs trace to data type mismatch
30%
Speed gain when MATCH replaces VLOOKUP
5
Most-common error sources to check first
60s
Average debug time once you know the patterns

Once you have flagged the matches or differences, the next step is usually cleanup. Excel has a built-in Remove Duplicates tool on the Data tab. Select your range, click the button, and Excel strips out repeated values in one pass. It is destructive, so copy your data first if you want to keep the original. For non-destructive duplicate flagging, stick with conditional formatting and the duplicate detection approach covered earlier.

Recruiters favor candidates who reach for XLOOKUP or INDEX MATCH first because that signals modern practice. If you are preparing for an analyst role, time yourself comparing two 1,000-row columns using each method. Aim to finish each comparison in under two minutes once formulas and shortcuts feel automatic. Mock interviews and timed practice tests reveal gaps in your skill set faster than passive video lessons.

Formulas vs Power Query at Scale

Pros

  • Power Query handles datasets larger than a million rows
  • Refresh button updates everything on demand
  • Step-by-step transformations document themselves
  • Anti-joins return mismatches directly without helper columns
  • Loads results to a clean output table

Cons

  • Steeper learning curve than basic formulas
  • Requires understanding of M language for custom logic
  • Refresh can be slow on poorly designed queries
  • Some features missing in Excel for Mac
  • Harder to debug than visible formula cells

After running your comparison formula, filtering the results turns insight into action. Click any cell and press Ctrl+Shift+L to toggle AutoFilter. Click the filter arrow on the comparison column and uncheck Match to see only the differences. Copy the filtered rows to a new sheet for follow-up.

For more flexibility, use the FILTER function in Excel 365: =FILTER(A2:C1000,C2:C1000="No Match") returns just the rows that need attention. This dynamic array spills into the destination range and updates live whenever the source data changes. Pair FILTER with SORT and UNIQUE to build an instant dashboard of mismatches sorted by priority. The combination replaces what used to require pivot tables and refreshes.

Quality Control After Every Comparison

๐Ÿ”ด Verify Coverage

Check the formula returned a result on every row. Empty cells signal a broken range reference.

๐ŸŸ  Spot-Check

Manually verify 3 known matches and 3 known mismatches before trusting the rest.

๐ŸŸก Reconcile Counts

Matched + unmatched should equal total source rows. Any gap means a bug.

๐ŸŸข Snapshot First

Save a copy before deleting rows flagged as duplicates. Recoveries cost hours.

๐Ÿ”ต Document Logic

Add a comment at cell A1 explaining what the comparison column means. Future-you will thank you.

You now have seven proven methods for comparing two columns, plus advanced workflows with INDEX MATCH, SUMPRODUCT, and Power Query. The best method depends on what you are looking for. Use IF when rows pair up. Use VLOOKUP or MATCH when values float around the list. Use Ctrl+\ when you need an answer in one second flat without typing a single character.

Use conditional formatting when a manager wants a visual sweep. Use EXACT for case-sensitive work. Use COUNTIF for duplicate analysis and overlap counts. Practice these patterns until they are second nature, then move on to pivot tables and dashboards. The skill compounds โ€” every formula you learn makes the next one easier to absorb.

Open a blank workbook, paste in two columns of sample data, and try each method right now while the patterns are fresh in your head. Time yourself on the first run, then again a week later. Watching your speed climb from three minutes to thirty seconds is the clearest signal that the muscle memory has taken hold. From there, the next natural step is dynamic array functions like FILTER and UNIQUE, which extend everything you learned here into a single-formula reporting workflow that updates live as the source data changes.

EXCEL Questions and Answers

What is the fastest way to compare 2 columns in Excel?

Select both columns and press Ctrl+\. Excel highlights every cell in the second column that does not match the cell to its left. The result appears in under a second with no formula. For row-by-row checks where the columns are meant to line up, this is the single fastest method built into Excel.

How do I compare 2 columns and highlight differences?

Select both columns, go to Home then Conditional Formatting then New Rule then Use a formula. Type =$A1<>$B1 and choose a red fill. Excel paints every row where the columns differ. Use =$A1=$B1 with green fill for matches. Stack both rules to see matches and mismatches at the same time.

Why does my IF formula say No Match when both cells look the same?

The usual culprit is trailing spaces or non-printing characters from a CSV or web import. Wrap your comparison in TRIM and CLEAN: =IF(TRIM(CLEAN(A2))=TRIM(CLEAN(B2)),"Match","No Match"). Data type mismatches between text and number cause the same silent failure โ€” check cell alignment.

Can VLOOKUP compare 2 columns for missing values?

Yes. Use =IFERROR(VLOOKUP(A2,$B$2:$B$1000,1,FALSE),"Missing"). It returns the matched value if found in column B, or Missing if not. Reverse the columns to find values only in B. The dollar signs lock the lookup range when you drag the formula down.

How do I do a case-sensitive comparison in Excel?

Use the EXACT function: =EXACT(A2,B2). It returns TRUE only when both cells match character-for-character including capitalization. Normal comparison operators and VLOOKUP treat APPLE and apple as identical. EXACT is the only safe choice for product codes or login names where case carries meaning.

What is the difference between VLOOKUP and XLOOKUP for comparison?

XLOOKUP is the modern replacement available in Excel 365 and 2021. It searches left or right, returns a default value natively without IFERROR, and uses cleaner syntax: =XLOOKUP(A2,$B$2:$B$1000,$B$2:$B$1000,"Missing"). VLOOKUP still works everywhere but feels dated and has the leftmost-column quirk.

How can I count duplicates between 2 columns?

Use COUNTIF in a helper column: =COUNTIF($B$2:$B$1000,A2). Then sum the results with =SUMPRODUCT((COUNTIF($B$2:$B$1000,A2:A1000)>0)*1). That returns the total count of values from column A that also appear in column B. Replace 0 with 1 to count values that appear more than once.

Can I compare two columns on different sheets?

Yes. Reference the other sheet in your formula: =IF(Sheet1!A2=Sheet2!A2,"Match","No Match"). For different workbooks the syntax is =VLOOKUP(A2,'[Other.xlsx]Sheet1'!$A:$A,1,FALSE) with the file name in square brackets. Cross-workbook formulas only update when both files are open.
โ–ถ Start Quiz