count .5V as 0.5, not 1 or 0

  • Thread starter Thread starter Guest
  • Start date Start date
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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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.
:grin:
 
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,223,355
Messages
6,171,608
Members
452,411
Latest member
sprichwort

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