How to Fix SUMIF Not Matching Imported Account Codes
Question details
The user is unable to get the SUMIF function to recognize and match account codes imported from MYOB to a budget sheet.
- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Using the SUMIF function to aggregate financial data based on account codes that were exported from an external accounting system (MYOB).
- Observed behavior
- The SUMIF function returns zero or fails to match the imported account codes unless the data is manually copied and pasted. Adjusting cell formatting does not resolve the issue, indicating the presence of invisible or non-printable characters blocking the match.
Before applying formulas to clean the text, temporarily widen your account code column to visually check for obvious trailing spaces, and confirm that your spreadsheet's calculation mode is set to Automatic.
Use the CLEAN Function to Remove Non-Printable Characters
The CLEAN function is specifically designed to strip invisible, non-printable characters from text imported from other applications, which are often the root cause of formula matching errors.
External software frequently exports data containing hidden characters that spreadsheets cannot interpret. Since these characters are invisible, the cells appear identical to the naked eye but fail logical matches in formulas like SUMIF, VLOOKUP, or MATCH.
Insert a new, blank helper column directly next to the column containing your imported MYOB account codes.
Click the first cell of the new helper column and type the formula =CLEAN(A2) (assuming A2 is your first account code), then press Enter.
Select the cell with the formula, click and hold the small square at the bottom-right corner (fill handle), and drag it down to apply the formula to all imported account codes.
Modify your existing SUMIF formula's criteria range to reference this newly created helper column instead of the original imported data column.
Overwrite Original Data Using Paste Special
If you do not want to rely on a helper column permanently, you can use the cleaned data to permanently overwrite the corrupted account codes.
Clean Imported Data Easily with WPS Spreadsheet
WPS Spreadsheet offers powerful text functions like CLEAN, TRIM, and text-to-columns to help you instantly fix imported data errors and formatting inconsistencies without breaking a sweat.
- 1. Open Your Data: Launch WPS Spreadsheet and open your imported MYOB budget file.
- 2. Apply Text Cleaning: Insert a blank column next to your account codes and enter =TRIM(CLEAN(A2)) to instantly strip out any invisible formatting anomalies.
- 3. Calculate Accurately: Drag the formula down to apply it to your dataset, then point your SUMIF function to these clean values for perfectly accurate totals.

Frequently Asked Questions
Why doesn't changing the cell format to 'Text' or 'General' fix the SUMIF error?
Changing the cell format from the ribbon only adjusts how the data is visually presented on your screen. It does not alter the underlying data or remove the invisible non-printable characters imported from external software, which is why the SUMIF matching still fails.
What if the CLEAN function doesn't fix the matching issue?
Sometimes external systems export a 'non-breaking space' (character code 160) which the standard CLEAN and TRIM functions do not remove. You can eliminate these stubborn spaces by using the SUBSTITUTE function: =SUBSTITUTE(A2, CHAR(160), "").
Can I remove invisible characters without using a helper column?
Yes. You can use the 'Text to Columns' feature found in the Data tab. Simply select your corrupted column, click 'Text to Columns', choose 'Delimited', clear all delimiter checkboxes, and click 'Finish'. This process forces the spreadsheet engine to re-evaluate the data and often strips out basic formatting errors automatically.




