Help: Sum characters in a range

DougStroud

Well-known Member
Joined
Aug 16, 2005
Messages
2,976
Office Version
  1. 365
Platform
  1. MacOS
I would like to sum three unique characters in a range: D1-D70. The characters are *,+,-

Thanks....

Doug
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I would like to sum three unique characters in a range: D1-D70. The characters are *,+,-
What exactly do you mean by "sum three unique characters"... count them? Are each of these characters in a cell by themselves or are they mixed in with other text in the cell? If they are mixed in, can there be more than one of them mixed in the text?
 
Upvote 0
Asuming that D1:D70 contains formula:

Is this function available in your version of Excel? (only works with recent versions)
=FORMULATEXT(D3)
(where D3 contains any formula)

If #NAME error is returned, then you need another method
Otherwise ...

In E1 copied down 70 rows
=LEN(FORMULATEXT($D1))-LEN(SUBSTITUTE(FORMULATEXT($D1),"+",""))
In F1 copied down
=LEN(FORMULATEXT($D1))-LEN(SUBSTITUTE(FORMULATEXT($D1),"*",""))
In G1 copied down
=LEN(FORMULATEXT($D1))-LEN(SUBSTITUTE(FORMULATEXT($D1),"-",""))

sum with
=SUM(E1:E70) etc
 
Last edited:
Upvote 0
If D1:D70 contains text (ie not formula) then use these:

=LEN($D1)-LEN(SUBSTITUTE($D1,"+",""))
=LEN($D1)-LEN(SUBSTITUTE($D1,"*",""))
=LEN($D1)-LEN(SUBSTITUTE($D1,"-",""))
 
Last edited:
Upvote 0
Sorry for the delayed response- we were out of the office due to weather.
Yes, count them. Thank you for clarifying with proper term.

The characters sit alone in individual cells; example:
D1 "+"
D2 "*"
D3 "-"
D4 "+"

"+" occurs 2 times
"*" occurs 1 time
"-" occurs 1 time
 
Last edited:
Upvote 0

Book1
CD
1+
2*
3-
4+
5
6+2
7*1
8-1
Sheet1
Cell Formulas
RangeFormula
D6=SUMPRODUCT(--($D$1:$D$4="+"))
D7=SUMPRODUCT(--($D$1:$D$4="*"))
D8=SUMPRODUCT(--($D$1:$D$4="-"))
 
Upvote 0
Try these
+
=COUNTIF(D1:D70,"*+*")
-
=COUNTIF(D1:D70,"*-*")
*
=COUNTA(D1:D70)-COUNTIF(D1:D70,"*+*")-COUNTIF(D1:D70,"*-*")
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top