Count lowest price per two arguments.

knaabis

Active Member
Joined
Apr 25, 2006
Messages
254
Office Version
  1. 2013
Platform
  1. Windows
I need to count for which store and how many this store has the lowest price for each product?
For example result - Shop1=0, Shop2=1, Shop3=2

Prod. Shop Price
Apple Shop1 5
Apple Shop2 3
Apple Shop3 4

Pears Shop1 8
Pears Shop2 7
Pears Shop3 6

Lemon Shop1 2
Lemon Shop2 3
Lemon Shop3 1
 
Last edited:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I would use a helper column, to identify for each product which store has the lowest prices.
Then use a SUMIF function on the results, to count how often stores have the lowest prices.

Watch out for situations where two or more shops both have the same lowest prices for the same product.
 
Upvote 0
Cols E & F work out the min for each product and location
Col H count them


Book1
ABCDEFGH
1Prod.ShopPrice
2AppleShop15Apple3Shop2Shop10
3AppleShop23Pears6Shop3Shop21
4AppleShop34Lemon1Shop3Shop32
5
6PearsShop18
7PearsShop27
8PearsShop36
9
10LemonShop12
11LemonShop23
12LemonShop31
Sheet3
Cell Formulas
RangeFormula
H2=COUNTIF(F:F,G2)
E2{=SMALL(IF($A$2:$A$12=D2,$C$2:$C$12),1)}
F2{=INDEX($B$2:$B$12,MATCH(D2&E2,$A$2:$A$12&$C$2:$C$12,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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