Sheetmend

8 common broken spreadsheet fixes, before and after

These are the breaks we see most in small-business workbooks: lookups that "can't find" a value that is plainly there, totals that come out 0 and counts that come up short. Each one shows the broken formula, the fixed formula and the result, using a small made-up price list. Everything works in Excel and Google Sheets unless noted.

Fictional sample data. The shop, codes and amounts are made up. Download the same examples as a workbook with a Before tab and an After tab and try the fixes yourself: sheetmend-before-after-fixes-SAMPLE-FICTIONAL.xlsx (Excel 2013 or newer; in Google Sheets use File > Import). Cell references below match that file.

First, find where it starts. One bad cell can spread an error down a column. Fix the first cell in the chain, not the last; our error guide shows how to trace it.

1. VLOOKUP returns #N/A, but the code is clearly in the list

Why: The code was typed or pasted with a space at the end ("P-101 ").

FormulaResult
Before=VLOOKUP(B2,Products!$A$2:$B$7,2,FALSE)#N/A
After=VLOOKUP(TRIM(B2),Products!$A$2:$B$7,2,FALSE)9

Tip: If the lookup list has stray spaces too, clean that column once with TRIM (or Data > Data cleanup > Trim whitespace in Google Sheets).

2. VLOOKUP returns #N/A on number codes

Why: The code 1042 is stored as text on one side and as a number on the other. They look identical.

FormulaResult
Before=VLOOKUP(B3,Products!$A$2:$B$7,2,FALSE)#N/A in Excel
After=VLOOKUP(VALUE(TRIM(B3)),Products!$A$2:$B$7,2,FALSE)4

Tip: Check both cells with =ISNUMBER(B3). If one says TRUE and the other FALSE, that's the problem. If the list holds the codes as text instead, use B3&"" to turn the number into text.

3. TRIM didn't fix it

Why: Text pasted from a web page often ends in a non-breaking space (character code 160), which TRIM leaves alone.

FormulaResult
Before=VLOOKUP(TRIM(B4),Products!$A$2:$B$7,2,FALSE)#N/A
After=VLOOKUP(TRIM(SUBSTITUTE(B4,UNICHAR(160)," ")),Products!$A$2:$B$7,2,FALSE)15.25

Tip: To spot it: =LEN(B4) is one longer than it looks, and =UNICODE(RIGHT(B4,1)) returns 160. UNICHAR needs Excel 2013 or newer; it works in Google Sheets.

4. VLOOKUP returns a price for a code that doesn't exist

Why: The last argument was left off, so VLOOKUP does an approximate match. On an unsorted list that can return a wrong row or #N/A.

FormulaResult
Before=VLOOKUP(B5,Products!$A$2:$B$7,2)wrong price or #N/A
After=IFNA(VLOOKUP(B5,Products!$A$2:$B$7,2,FALSE),"Not listed")Not listed

Tip: Use FALSE (or 0) for codes, names and IDs. Use IFNA rather than IFERROR so a typo elsewhere in the formula still shows up.

5. #DIV/0! in an average

Why: A month with no orders yet divides by zero.

FormulaResult
Before=Data!H2/Data!G2#DIV/0!
After=IF(Data!G2=0,"",Data!H2/Data!G2)(blank)

Tip: Blank is better than 0 here, so a chart or average doesn't treat an empty month as a real zero.

6. Formula works in row 2, breaks further down

Why: The lookup range wasn't locked, so it slid down as the formula was copied and stopped covering the top of the list.

FormulaResult
Before=VLOOKUP(B7,Products!A4:B9,2,FALSE)#N/A
After=VLOOKUP(B7,Products!$A$2:$B$7,2,FALSE)12.5

Tip: Lock ranges with $ (press F4 in Excel). Better still, turn the list into a table (Insert > Table) so it grows with new rows.

7. Monthly total shows 0

Why: The dates were pasted as text ("2026-03-07"), so they never match date criteria.

FormulaResult
Before=SUMIFS(Data!$B$2:$B$4,Data!$A$2:$A$4,">="&DATE(2026,3,1),Data!$A$2:$A$4,"<"&DATE(2026,4,1))0
AfterHelper column Data!C2: =DATEVALUE(TRIM(A2)), then =SUMIFS(Data!$B$2:$B$4,Data!$C$2:$C$4,">="&DATE(2026,3,1),Data!$C$2:$C$4,"<"&DATE(2026,4,1))150

Tip: Quick test: real dates are right-aligned and =ISNUMBER(A2) is TRUE. DATEVALUE reads year-month-day text reliably; other orders depend on your locale.

8. Count of "Paid" is too low

Why: One status was typed with a trailing space ("Paid "). COUNTIF ignores upper and lower case, but not spaces.

FormulaResult
Before=COUNTIF(Data!$E$2:$E$6,"Paid")3
After=SUMPRODUCT(--(TRIM(Data!$E$2:$E$6)="Paid"))4

Tip: Long-term fix: a drop-down list (Data > Data Validation in Excel; Insert > Dropdown in Sheets) so it can't be typed nine ways again.

Still stuck?

Send us the file. A Formula Fix ($29) covers one error or one formula that isn't doing what you want, with a plain-English note on what was wrong, within 1 business day. A Workbook Tune-Up ($89) fixes every error in a workbook of up to 5 tabs and adds a "What we changed" tab (see a sample change log). No calls, no logins.

Fix one formula, $29Fix the whole workbook, $89