Forum Discussion
COUNT
- Oct 14, 2023
=SUMPRODUCT(LEN($A2:$AO2)-LEN(SUBSTITUTE($A2:$AO2,AP$1,"")))Does this return the intended output?
To count the occurrences of "D," "U," and "S" in each row in columns AP, AQ, and AR, you can use the following Excel formulas. Assuming your data starts in row 2 (adjust the cell references accordingly if your data starts in a different row):
In cell AP2, you can enter the following formula to count "D"s:
=LEN(A2)-LEN(SUBSTITUTE(A2,"D",""))
In cell AQ2, you can enter the following formula to count "U"s:
=LEN(A2)-LEN(SUBSTITUTE(A2,"U",""))
In cell AR2, you can enter the following formula to count "S"s:
=LEN(A2)-LEN(SUBSTITUTE(A2,"S",""))
Drag these formulas down in columns AP, AQ, and AR to apply them to each row in your dataset.
These formulas work by first substituting the target character with an empty string in the original text and then subtracting the length of the modified text from the length of the original text. This counts the number of occurrences of the specific character in the cell.
The text and steps were edited with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.
- anupambit1797Oct 15, 2023Iron Contributor
HiNikolinoDE , in your solution, seems the output is not correct.. as below , it should come 28 for the 1st row.. etc.
or please correct me , if I mis-interpret the formula
Thanks & Regards
Anupam Shrivastava