How to Fix Excel #DIV/0! Errors When Calculating CSV Percentages on Mac
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.

- 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.
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.
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.
Navigate to the Data tab and select 'Get Data (Power Query)' to open your CSV file.
Instead of immediately loading the data, click the 'Transform Data' button to open the Power Query Editor.
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.
Click the 'ABC' data type icon in the column header and select 'Decimal Number' or 'Percentage' to convert the text entries into valid numbers.
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.

Match CSV Locale Settings During Import
Specify the origin locale of the CSV file during the import process so Excel correctly interprets regional formatting.
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.

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.




