Formula Question


Posted by Mark on June 21, 2001 2:41 PM

I am trying to assign number values to letters in Excel. I will be entering the letters “p” and “a” in cell range A1:E1 and want their value to each equal the number 1. I want the number of p’s and a’s to be totaled in cell F1. I want only the p’s to be totaled in cell G1. Can anyone help with the formula(s)?

Posted by IML on June 21, 2001 2:47 PM

In F1 you can use:
=COUNTIF(A1:E1,"a")+G1

In G1,
=COUNTIF(A1:E1,"p")



Posted by Mark W. on June 21, 2001 2:50 PM

In cell F1 enter the array formula...

{=SUM((A1:E1={"a";"p"})+0)}

Note: Array formulas are entered using the
Control+Shift+Enter key combination. The outermost
braces, {}, are not entered by you. They're
supplied by Excel in recognition that you've
properly entered an array formula.

In cell G1 enter the formula, =COUNTIF(A1:E1,"p").