I have a range, containing numeric values & blank cells. Some of the numeric values will have * as suffix.
10* 5 7 9 25* 10
When I do a SUM(A1:A8), I get result of 5+7+9+10 = 31, the required output.
Now, I also require the total sum irrespective of * suffix. I’m trying to solve by using
SUMPRODUCT(SUBSTITUTE(A1:A8,"*",""))
It works out to
SUMPRODUCT({"10","5","7","","9","","25","10"})
And outputs 0 since all are text values. When I use
SUMPRODUCT(value(SUBSTITUTE(A1:A8,"*","")))
It works out to
SUMPRODUCT({10,5,7,#VALUE!,9,#VALUE!,25,10})
and finally outputs #Value!. Can someone help me to solve this? Thanks for your time.
I assume that the blanks are the problem because when you use =VALUE(“”) you get an error. Try concatenating a zero to the start of SUBSTITUTE so that blanks become zeroes
=SUMPRODUCT(VALUE(0&SUBSTITUTE(A1:A8,"*","")))or you can use +0 in place of VALUE, i.e.
=SUMPRODUCT((0&SUBSTITUTE(A1:A8,"*",""))+0)