Can I use COUNTIF for 2 values?

ICT-Craig

New Member
Joined
Nov 29, 2005
Messages
5
Hi,

I'm trying to gather info from a raw data sheet (sheet B), to create a summary sheet (sheet A).

Sheet B contains data in a 7 column/250 row array which is auto filtered.

So far I've managed to use COUNTIF in sheet A where the criteria is one column is sheet B.
But what I would like to do is use COUNTIF with criteria in 2 columns on sheet B?

Thanks in advance,

Craig (xl 2k)
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

GorD

Well-known Member
Joined
Jan 17, 2004
Messages
1,447
For 2 criteria you need to use sumproduct - which will count the matching entries.
 

ICT-Craig

New Member
Joined
Nov 29, 2005
Messages
5
thanks for the reply :)

how would i impliment that against my current formula:
=COUNTIF('Sheet B'!C2:C250,B6)
[B6 is matching criteria on sheet A]

thanks
 

GorD

Well-known Member
Joined
Jan 17, 2004
Messages
1,447
Could you post some sample data and what criteria you wish to filter on
 

ICT-Craig

New Member
Joined
Nov 29, 2005
Messages
5

ADVERTISEMENT

sheeta2dc.jpg


sheetb2hk.jpg


linkage corrected :oops: :)
 

ICT-Craig

New Member
Joined
Nov 29, 2005
Messages
5
i would like sheetA 'reserved' column to display the sum of username=reserved + unit=xxxxx

does that make sense? :confused: :)
 

GorD

Well-known Member
Joined
Jan 17, 2004
Messages
1,447

ADVERTISEMENT

Try

=SUMPRODUCT(--(Sheet1!B1:B9="reserved"),--(Sheet1!C1:C9="xxxxx"))
 

GorD

Well-known Member
Joined
Jan 17, 2004
Messages
1,447
Basically, they change the trues and falses returned into 1 and 0's that can then be added.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,546
Messages
5,838,029
Members
430,526
Latest member
NiceGuyWithExcel2007

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
Top