logo
search
Formula Errors

How to Fix Excel #DIV/0! Errors When Calculating CSV Percentages on Mac

Huda QurayshiHuda Qurayshi Sep 27, 2026 869 views

Question details

The user needs to resolve a #DIV/0! error in Excel on Mac that occurs when calculating percentages or averages from data imported from a CSV file.

How to Fix Excel #DIV/0! Errors When Calculating CSV Percentages on Mac
Product
Microsoft Excel
Device & OS
macOS
Scenario
Calculating averages or percentages from data imported from a CSV file using Power Query.
Observed behavior
Excel returns a #DIV/0! error even though the denominator values appear to be non-zero, usually because the imported CSV numbers are being treated as text due to locale mismatches.
Before you start

Ensure your CSV file is completely saved and closed in other applications, and verify your Mac's system region and language settings match the origin of your data.

Solution 1Recommended

Transform CSV Data Types in Power Query Before Loading

Use Power Query's Transform feature to ensure numeric values are properly recognized as numbers instead of text, resolving regional format mismatches.

When Excel imports CSV data, differences in regional settings (such as using commas instead of periods for decimals) can cause numbers to be imported as text. Mathematical functions will ignore these text cells, causing a #DIV/0! error.

1
Import CSV with Power Query

Navigate to the Data tab and select 'Get Data (Power Query)' to open your CSV file.

2
Open the Transform Editor

Instead of immediately loading the data, click the 'Transform Data' button to open the Power Query Editor.

3
Inspect Data Types

Look at your percentage or numeric columns. If they are aligned to the left or display a text data type icon (ABC) in the column header, Excel is treating them as text.

4
Convert to Real Numbers

Click the 'ABC' data type icon in the column header and select 'Decimal Number' or 'Percentage' to convert the text entries into valid numbers.

5
Load and Recalculate

Click 'Close & Load' on the Home tab to return the corrected data to your worksheet. Your formulas should now calculate without the #DIV/0! error.

Transform CSV Data Types in Power Query Before Loading
Data Format Confirmed: Once converted to valid numbers, mathematical formulas like AVERAGE will correctly evaluate the data without throwing #DIV/0! errors.
Free Microsoft Office alternative

Use WPS Office for Hassle-Free CSV Data Imports on Mac

If Excel's regional settings continue to cause formula errors on your Mac, try WPS Office. It provides an intuitive CSV import wizard that makes managing data formats seamless, ensuring your formulas work perfectly.

Completely free, fast, and lightweight office suite for macOSSeamlessly open, edit, and save Microsoft Excel (.xlsx) and CSV formatsIntuitive CSV import wizard to easily assign correct data types without errorsFamiliar user interface with zero learning curve for Excel users
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel show #DIV/0! when my denominator is clearly not zero?

This happens when Excel treats the cell values as text rather than numbers. Mathematical functions like AVERAGE ignore text cells completely, which effectively results in a denominator of zero during the calculation, triggering the error.

How do regional settings affect CSV imports on a Mac?

Different regions use different characters for decimal points and thousand separators (e.g., European regions often use a comma instead of a period). If the CSV's format doesn't match your Mac's system settings, Excel fails to recognize the values as numbers and defaults them to text strings.

Can I fix the #DIV/0! error without using Power Query?

Yes. You can use the 'Text to Columns' feature under the Data tab to force Excel to convert text-formatted numbers back into real numbers. Additionally, you can wrap your formulas with the IFERROR function (e.g., =IFERROR(A1/B1, 0)) to hide the error display.