COUNTIFS with less than greater than

EswarA

New Member
Joined
Apr 24, 2022
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
Hello,
Please help me to get count after some conditions.
Pls find below excel sheet with columns DP, Txn Code, Product, Amount.
Conditions to consider:
DP- 1259
Txn code- 1401
Product- 1 to 200, 300 to 600, above 800.
Txn amount- <45000

I am writing formula which is wrong
=COUNTIFS(A:A,"1259",B:B,"1401",COUNTIFS(C:C,"<200",C:C,">800")+COUNTIFS(C:C,">300",C:C,"<600"),D:D,"<45000")

Please guide and provide simple formula.
 

Attachments

  • IMG-20220424-WA0030.jpg
    IMG-20220424-WA0030.jpg
    174.7 KB · Views: 7
  • IMG-20220424-WA0030.jpg
    IMG-20220424-WA0030.jpg
    174.7 KB · Views: 5

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I suggest you use SUMPRODUCT.
For example, if G3 and downward you have your DP numebers, in H3-I3 you have your Txn codes, then try in H3
Excel Formula:
=SUMPRODUCT(--($A$2:$A$1000=$G3),--($B$2:$B$1000=H$2),($C$2:$C$1000>1)*($C$2:$C$1000<200)+($C$2:$C$1000>300)*($C$2:$C$1000<600)+($C$2:$C$1000>800))
Adapt those "1000" in case you plan to have more than 1000 rows of data

Then copy H3 to the right (for more Txn codes) and down (for all of your DPs)

Bye
 
Upvote 0
I suggest you use SUMPRODUCT.
For example, if G3 and downward you have your DP numebers, in H3-I3 you have your Txn codes, then try in H3
Excel Formula:
=SUMPRODUCT(--($A$2:$A$1000=$G3),--($B$2:$B$1000=H$2),($C$2:$C$1000>1)*($C$2:$C$1000<200)+($C$2:$C$1000>300)*($C$2:$C$1000<600)+($C$2:$C$1000>800))
Adapt those "1000" in case you plan to have more than 1000 rows of data

Then copy H3 to the right (for more Txn codes) and down (for all of your DPs)

Bye
Thank you
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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