Hi!
I want to sume numbers that may or may not be in several cells. If I use the function SUM and one of them is missing, I get an error.
Example:
A1=2
A2="empty"
A3=5
I want the sum of A1+A2+A3 to be 5
Any ideas?
Hi!
I want to sume numbers that may or may not be in several cells. If I use the function SUM and one of them is missing, I get an error.
Example:
A1=2
A2="empty"
A3=5
I want the sum of A1+A2+A3 to be 5
Any ideas?
Do you mean?
Formula:Please Login or Register to view this content.
Regards
Fotis.
-This is my Greek whisper to Europe.
--Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Advanced Excel Techniques: http://excelxor.com/
--KISS(Keep it simple Stupid)
--Bring them back.
---See about Acropolis of Athens.
--Visit Greece.
What formula are you using?
If I enter =SUM(A1:A3) with the values you suggest, i get a result of 7, which is correct, I believe?
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
When you say "empty", please can you clarify. Your formula should cope with an empty/null cell. However, if it has a space or a non numeric character it won't.
A B C 1 2 #VALUE! =A1+A2+A3 2 x 7 =SUM(A1:A3) 3 5 7 =N(A1)+N(A2)+N(A3) 4 7 =SUMPRODUCT(--(ISNUMBER($A$1:$A$3)),($A$1:$A$3))
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Yes.
Big difference between using =A1+A2+A3 and =SUM(A1:A3)
The latter ignores text values in the range; the former does not.
I can only imagine that your "blanks" in the range are not "genuine" blanks, but perhaps the "" (which are technicallly text) as a result of e.g. formulas in those cells.
Regards
Added Fotis's formula as another option:
A B C 1 2 #VALUE! =A1+A2+A3 2 x 7 =SUM(A1:A3) 3 5 7 =N(A1)+N(A2)+N(A3) 4 7 =SUMPRODUCT(--(ISNUMBER($A$1:$A$3)),($A$1:$A$3)) 5 7 =SUMIF(A1:A3,"<>")
Regards, TMS
Thanks for the rep
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks