![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
|
Quote:
{".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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
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 |
|
Guest
Posts: n/a
|
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 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|