Thanks:  0
Likes:  0

Thread: count .5V as 0.5, not 1 or 0

1. I work on an attendance spreadsheet where the cells values are V, S, .5V and .5S. I can get the formula to count each V as 1, but it won't recognize .5V as 0.5 and count it as .5

Can anyone help me?

2. On 2002-02-28 20:50, Anonymous wrote:
I work on an attendance spreadsheet where the cells values are V, S, .5V and .5S. I can get the formula to count each V as 1, but it won't recognize .5V as 0.5 and count it as .5

Can anyone help me?
Consider the following sample

{".5V";
"V";
"S";
".5V";
"V";
".5S";
"V"}

in A1:A7.

In B1 enter: V [ the item of interest ]

In C1 array-enter:

=COUNTIF(A1:A7,B1)+SUM((IF(ISNUMBER(SUBSTITUTE(A1:A7,B1,"")+0),SUBSTITUTE(A1:A7,B1,"")+0)))

This will "sum" B1-values that occur in the range of interest.

To array-enter a formula, you need to hit control+shift+enter at the same time, not just enter.

3. Use...

=COUNTIF(A:A,".5V")/2+COUNTIF(A:A,"V")

...where column A contains your attendance values.

Or, use the array formula...

{=SUM((A1:A4={"V",".5V"})*{1,0.5})}

...where your values are in the cell range A1:A4.

Note: Array formulas must be entered using the Control+Shift+Enter key combination. The outermost braces, {}, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.

[ This Message was edited by: Mark W. on 2002-03-01 09:06 ]

4. Thank you Mark! The COUNTIF formula worked, whereas the array formula gave me a #VALUE! error. And yes, I did press CTRL-SHIFT-ENTER.

5. On 2002-03-01 18:16, Anonymous wrote:
Thank you Mark! The COUNTIF formula worked, whereas the array formula gave me a #VALUE! error. And yes, I did press CTRL-SHIFT-ENTER.
[img]/board/images/smiles/icon_biggrin.gif[/img]
That the array-formulas return a #VALUE! rror seems to indicate that you have formula-returned blanks in the range of interest.

User Tag List

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•