Excel formula

doris.barrett

New Member
Joined
Sep 19, 2002
Messages
1
Need to check a range of cells = 4 or 5 and return the number of cells that meet the condition.
This message was edited by doris.barrett on 2002-09-20 11:16
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

IML

MrExcel MVP
Joined
Feb 15, 2002
Messages
1,743
You could use
=COUNTIF(yourrange,4)+COUNTIF(yourrange,5)

good luck
 

Brenkenathan

Board Regular
Joined
Sep 19, 2002
Messages
146
COUNTIF(range,criteria)
example: CountIf(A1:A40,4)

This is really nice expecially if you only need it to count if you have a reason but it counts by itself too
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650

ADVERTISEMENT

Example

=COUNTIF(C1:C9,4)+COUNTIF(C1:C9,5)
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,971
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
1. try countif =COUNTIF(A1:F4,4)+COUNTIF(A1:F4,5)

with criteria in G7 and G8
=COUNTIF(A1:F4,G7)+COUNTIF(A1:F4,G8)

or

2 SumProduct
=SUMPRODUCT((A3:F3={4;5})+0)
with criteria in G7:G8
=SUMPRODUCT((A3:F3=G7:G8)+0)
or
=SUMPRODUCT((C1:C4={4,5})+0)
or with criteria in G7:H7
=SUMPRODUCT((C1:C4=G7:H7)+0)

Adjust the references as necessary.
 

Forum statistics

Threads
1,144,312
Messages
5,723,650
Members
422,508
Latest member
Lordkit1

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