count .5V as 0.5, not 1 or 0

G

Guest

Guest
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?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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.
 
Upvote 0
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
 
Upvote 0
Thank you Mark! The COUNTIF formula worked, whereas the array formula gave me a #VALUE! error. And yes, I did press CTRL-SHIFT-ENTER.
:biggrin:
 
Upvote 0
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.
/board/images/smiles/icon_biggrin.gif

That the array-formulas return a #VALUE! rror seems to indicate that you have formula-returned blanks in the range of interest.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

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