![]() |
![]() |
|
|||||||
| 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 |
|
Board Regular
Join Date: May 2002
Posts: 54
|
Help please, new to Excel.
If in column A and in Column B 1 fred 1 bill 1 bill 3 fred 4 dave 5 bill how do I get a cell to show a count of Bill only when 1 in column A result = 2 Hope that makes sence thanks [ This Message was edited by: ch1 on 2002-05-11 15:51 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
where A2:A7 houses the numbers, B2:B7 the names, E1 the criterion number 1, and E2 the criterion name Bill. |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi Aladin....
Why isn't this formula working? =SUMPRODUCT(COUNTIF(B:B,"bill")*COUNTIF(A:A,1)) I listed them seperately and these are the results. COUNTIF(B:B,"bill") = 0 COUNTIF(A:A,1)) = 3 Thanks, Tom [ This Message was edited by: TsTom on 2002-05-11 16:04 ] |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: May 2002
Posts: 54
|
Thanks, I have tried that and get a result of 0.
?????????????? |
|
|
|
|
|
#5 | ||
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
Quote:
I use xl2000 with windows2000 prof
__________________
Best Regards Andreas
|
||
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
[i]
Why isn't this formula working? =SUMPRODUCT(COUNTIF(B:B,"bill")*COUNTIF(A:A,1)) I listed them seperately and these are the results. COUNTIF(B:B,"bill") = 0 COUNTIF(A:A,1)) = 3 [i] Tom, That formula "works", not the way we want. It would result in 9, because COUNTIF(A:A,1) ==> 3 and COUNTIF(B:B,"bill") ==> 3. Hence: =SUMPRODUCT(3*3) ==> 9 What is desired is something different: =SUMPRODUCT((A2:A7=1)*(B2:B7="Bill")) works, put in stages, as follows: eValuation Stage: =SUMPRODUCT({TRUE;TRUE;TRUE;FALSE;FALSE;FALSE}*{FALSE;TRUE;TRUE;FALSE;FALSE;TRUE}) Multiplication (PRODUCT) Stage: =SUMPRODUCT({0;1;1;0;0;0}) Addition (SUM) Stage: =2 For more on this, see: http://www.mrexcel.com/wwwboard/messages/8961.html Aladin [ This Message was edited by: Aladin Akyurek on 2002-05-11 16:41 ] |
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
[ This Message was edited by: Aladin Akyurek on 2002-05-11 16:41 ] |
|
|
|
|
|
|
#8 |
|
Board Regular
Join Date: May 2002
Posts: 54
|
Thanks
Typed it in again and it worked. I said I was new, just proved it Many thanks |
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Thanks Aladin
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|