Excel Formula conditional IF and Count and a range

salallan

New Member
Joined
Sep 25, 2010
Messages
5
Hi,

I want to anylise some data in excel, the data comes from a dump from a database

Region, Days open, Ticket Number

I am try to create a formula that goes and counts the number of instance in each region so.

I will have multiple entries

Region, Days open, Ticket Number
America 10 tick1
America 15 tick2
UK 5 tick3
Asia 20 tick4
America 7 tick5
UK 2 tick9


The formula or condition would populate my table based on the condition below,

count the number of instances where its greater then 10 but less then or equal to 20, and return me the count for each region

America 2
UK 0
Asia 1

Please could some help

I have had a look at arrays conditional sums and if statements but cannot get it work.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try like this

Excel Workbook
ABCDEF
1Region,DaysTicketAmerica2
2America10tick1UK0
3America15tick2Asia1
4UK5tick3
5Asia20tick4
6America7tick5
7UK2tick9
Sheet6
 
Upvote 0
If your specification is :

Days >10 and <=20

then, the result will be :

America….1
UK…………..0
Asia…….….1

Not,

America….2
UK…………..0
Asia…….….1

Formula in F1,

=SUMPRODUCT(--(A$2:A$7=E1),--(B$2:B$7>10),--(B$2:B$7<=20))

or,

=SUM(INDEX((A$2:A$7=E1)*(B$2:B$7>10)*(B$2:B$7<=20),))

Regards
 
Upvote 0
tried that it also works, I wanted to add a bit more complication to the formula,

the data will look as follows


Region, day, ticket, team

America 10 tick1 team1
America 15 tick2 team2
UK 5 tick3 team3
ASIA 20 tick4 team4
America 7 tick5 team2
America 15 tick6 team1
UK 2 tick7 team3
America 17 tick8 team9

so the forumla is the same but with added extra condition

results will be for >=10 <=20, Region = America, team=1 or team2
>=10 <=20, Region = Asia, team=4 or team5

So my results will be
America 3
Asia 1

and so on, any further help is very much appricated, if someone can assist today.

thank you all
 
Upvote 0
1] Column D for the name of : team1, team2………

2] For conditions : >=10 <=20, Region = America, team=1 or team2

2.1] Formula :

=SUMPRODUCT(--(A$2:A$9="America"),--(B$2:B$9>=10),--(B$2:B$9<=20),((D$2:D$9="team1")+(D$2:D$9="team2")))

Or,

=SUM(INDEX((A$2:A$9="America")*(B$2:B$9>=10)*(B$2:B$9<=20)*((D$2:D$9="team1")+(D$2:D$9="team2")),))


3] For conditions : >=10 <=20, Region = Asia team=4 or team5

3.1] Formula :

=SUMPRODUCT(--(A$2:A$9="Asia"),--(B$2:B$9>=10),--(B$2:B$9<=20),((D$2:D$9="team4")+(D$2:D$9="team5")))

Or,

=SUM(INDEX((A$2:A$9="Asia")*(B$2:B$9>=10)*(B$2:B$9<=20)*((D$2:D$9="team4")+(D$2:D$9="team5")),))

Regards
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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
Back
Top