Count how many times the code is between a price

umirin

Board Regular
Joined
Jul 31, 2016
Messages
58
Office Version
  1. 365
Platform
  1. Windows
Hi
I'm looking for a formula that will go in F2:H4 that will count how many times the code falls between the price

the Formula results should look like this.

CodePrice 1-100Price 100-200Price 200+
DDL31
GHG13
LKJ4

Book1
ABCDEFGH
1CodePriceCodePrice 1-100Price 100-200Price 200+
2DDL45DDL
3DDL67GHG
4DDL43LKJ
5DDL6544
6GHG109
7GHG198
8GHG156
9GHG7
10LKJ678
11LKJ654
12LKJ333
13LKJ1111
Sheet1
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Maybe this:
Book1.xlsm
EFGH
1CodePrice 1-100Price 100-200Price 200+
2DDL301
3GHG130
4LKJ004
Sheet7
Cell Formulas
RangeFormula
F2:F4F2=COUNTIFS($A:$A,$E2,$B:$B,">=1",$B:$B,"<=100")
G2:G4G2=COUNTIFS($A:$A,$E2,$B:$B,">=100",$B:$B,"<=200")
H2:H4H2=COUNTIFS($A:$A,$E2,$B:$B,">200")
 
Upvote 0
In F2
Excel Formula:
=COUNTIFS($B$2:$B$13,">=1",$B$2:$B$13,"<=100",$A$2:$A$13,$E2)

In G2
Excel Formula:
=COUNTIFS($B$2:$B$13,">=100",$B$2:$B$13,"<=200",$A$2:$A$13,$E2)

In H2
Excel Formula:
=COUNTIFS($B$2:$B$13,">200",$A$2:$A$13,$E2)
 
Upvote 0
Zeszyt1
ABCDEFGH
1CodePriceCodePrice 1-100Price 101 -200Price > 200
2DDL45DDL301
3DDL67GHG130
4DDL43LKJ004
5DDL6544    
6GHG109    
7GHG198    
8GHG156    
9GHG7    
10LKJ678
11LKJ654
12LKJ333
13LKJ1111
14
15
16
Arkusz1
Cell Formulas
RangeFormula
E2:E9E2=IFERROR(INDEX(code_,MATCH(0,COUNTIF($E$1:E1,IF(code_="","",code_)),0)),"")
F2:F9F2=IF(E2="","",COUNTIFS(code_,$E2,price,"<="&F$1))
G2:G9G2=IF($E2="","",COUNTIFS(code_,$E2,price,">"&F$1,price,"<="&G$1))
H2:H9H2=IF($E2="","",COUNTIFS(code_,$E2,price,">" & H$1))
Press CTRL+SHIFT+ENTER to enter array formulas.
Named Ranges
NameRefers ToCells
code_=Arkusz1!$A$2:$A$13E2:H9
price=Arkusz1!$B$2:$B$13F2:H9
 
Upvote 0
@umirin,

For price 100 where you need to put counting? Maybe...
CodePrice 1-100Price 101-200Price 200+

F2=COUNTIFS($B$2:$B$50,"<=100",$A$2:$A$50,$E2)
G2=COUNTIFS($B$2:$B$50,">100",$B$2:$B$50,"<=200",$A$2:$A$50,$E2)
H2=COUNTIFS($A:$A,$E2,$B:$B,">200")
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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