Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default countif, multiple value range PLEASE HELP

I have a set of data where I want to count some values with a range of
different outcomes:

a b c d
a a c e

0 = COUNTIF(A2:D2,OR(A1,B1,C1,D1))
3 <-- Answer I want to get

The Bottom answer is what I want to get
The Top answe is what I am getting

Is there a way of doing this without doing a long formula such as:
= COUNTIF(A2:D2,A1)+COUNTIF(A2:D2,B1)+COUNTIF(A2:D2, C1)+COUNTIF(A2:D2,D1)

My formula is already very complicated so I want to avoid doing this if
possible
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default countif, multiple value range PLEASE HELP

This is slightly shorter:

=SUMPRODUCT((A2:D2=A1)+(A2:D2=B1)+(A2:D2=C1)+(A2:D 2=D1))

Hope this helps.

Pete

On Dec 18, 2:33*pm, laandmc wrote:
I have a set of data where I want to count some values with a range of
different outcomes:

a * * * b * * * c * * * d
a * * * a * * * c * * * e

0 * * * = * * * COUNTIF(A2:D2,OR(A1,B1,C1,D1)) *
3 * * * <-- *Answer I want to get * *

The Bottom answer is what I want to get
The Top answe is what I am getting

Is there a way of doing this without doing a long formula such as:
= COUNTIF(A2:D2,A1)+COUNTIF(A2:D2,B1)+COUNTIF(A2:D2, C1)+COUNTIF(A2:D2,D1)

My formula is already very complicated so I want to avoid doing this if
possible


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default countif, multiple value range PLEASE HELP

=SUMPRODUCT(COUNTIF(RangeB,RangeA))
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMPRODUCT, SUMIF, COUNTIF for multiple sheets for multiple criter Greg in CO[_2_] Excel Worksheet Functions 0 September 18th 08 05:51 PM
Nesting COUNTIF for multiple criteria in multiple columns NeedExcelHelp07 Excel Worksheet Functions 1 December 12th 07 05:47 PM
CountIf for a range with multiple criteria Marco Excel Discussion (Misc queries) 5 August 27th 07 01:10 PM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
Countif with multiple criteria and multiple worksheets JJ Excel Worksheet Functions 1 December 28th 04 06:37 PM


All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"