Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

number formatting error

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Number formatting error

Number formatting error

Medium priorityVersion 365

Number formatting error

Hi
This forum kindly provided some guidance on transposing data (achieved using power query). As a result I now have data in the format below. The formatting as a table shown below isn’t very clear but basically three assessors are each giving numerical assessments (rankings) to various investment proposals.

Assessor_1 Assessor_2 Assessor_3
Proposal_A 1 1 2
Proposal_B 2 3 1
Proposal_C 3 2 3

The following would also be valid as assessors can enter ‘n/a’ if they do not wish to rate a proposal:

Proposal_D 1 2 n/a

I have a separate tab on my spreadsheet that takes as input data in this format and then performs various statistical analyses on it. The data handling routines were written by a colleague and it is probably impractical for me to make changes to it.

I have tested this spreadsheet using test data (which LOOKS the same) and it works. However when it links to my own data is does not calculate correctly. I noticed the SUM function returns 0 instead of correctly summing values across a row.

Having investigated I strongly suspect that there is a formatting issues involved. If I copy a range of cells using the formula below and then apply the statistics to the output values they start working again.

=IFERROR(VALUE(A1:C6), A1:C6)

The handling of ‘n/a’ was addressed in the previous advice. It is important that the analysis routines include ‘n/a’ as part of their calculations e.g. by counting number of proposals actually scored.

Is using the line of code shown above the most efficient way to copy and address the formatting issues?
Advice appreciated. I have the impression this is a common sort of query.

Mat

RE: Number formatting error

Hi Matthew,

Thank you for the forum question,

You’re on the right track—this is a very common Excel issue. What you’re seeing is almost certainly caused by numbers being stored as text, which is why SUM returns 0.
Your workaround:
=IFERROR(VALUE(A1:C6), A1:C6)
does work, but it’s not the most efficient or scalable solution (especially across larger ranges or tables). Here are better approaches depending on your setup.
________________________________________
Root cause
The imported/transposed data (likely from Power Query) is coming through as:
• Text values that look like numbers (e.g. "1" instead of 1)
• Plus literal text like "n/a"
Excel math functions ignore text → result = 0
________________________________________
Best solutions
Option 1: Fix it in Power Query (recommended)
Since you’re already using Power Query, this is the cleanest and most efficient solution.
In Power Query:
1. Select the assessor columns
2. Set data type to:
o Whole Number
3. Replace "n/a" with:
o null (so Excel treats it as blank)
Why this works:
• Numbers become true numeric values
• null behaves properly in calculations (ignored in sums, but countable if needed)
If you must keep "n/a" visible, you can convert to numbers for calculations and then re-display later in Excel
________________________________________
🔹 Option 2: Use a helper formula (better than your current one)
Instead of applying VALUE to an array, process each cell like this:
=IF(A1="n/a","n/a",--A1)
or safer:
=IFERROR(--A1, A1)
Why better than your formula:
• --A1 (double unary) is faster and more commonly used than VALUE
• Works cleanly row-by-row
• Keeps "n/a" intact
________________________________________
🔹 Option 3: Convert in place (fast manual fix)
If you don’t want formulas:
Method A: Multiply trick
1. Enter 1 in an empty cell
2. Copy it
3. Select your data range
4. Paste Special → Multiply
Converts text numbers to real numbers instantly
Will error on "n/a" unless filtered/handled first
________________________________________
Method B: Text to Columns
1. Select the data
2. Go to Data → Text to Columns
3. Click Finish
Forces Excel to re-evaluate data types
________________________________________
🔹 Option 4: Use VALUE only where needed
If sticking with formulas, refine yours like this:
=IF(A1="n/a","n/a",VALUE(A1
________________________________________
Handling "n/a" in analysis
Since your statistical sheet expects "n/a":
• Keep "n/a" as text
• Convert only valid numbers
For counting valid entries:
=COUNT(range)
For counting all entries including "n/a":
=COUNTA(range)
________________________________________
Summary (what you should do)
Best overall approach:
• Fix data types in Power Query
• Convert "n/a" → null
If working in Excel only:
• Use:
=IFERROR(--A1, A1)
Avoid:
• Array use of VALUE() like your current formula (inefficient and harder to manage)
________________________________________
Quick diagnostic tip
To confirm the issue:
=ISNUMBER(A1)
• FALSE → your number is stored as text
________________________________________
If you want, I can help you tweak your Power Query steps so this is solved permanently at the source



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Excel tip:

Adding date and time

Here are two quick ways to add the date and time to your spreadsheet:

1) Type =NOW(), which displays both date and time in the same cell
or
2) Hold Ctrl and type the colon (:) into one cell for the date and the semi-colon(;)into another for the time.

Note that =NOW() updates to the current date/time whenever the spreadsheet recalculates.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.14 secs.