Find smallest number with multiple criteria

brianclong

Board Regular
Joined
Apr 11, 2006
Messages
168
I need a formula that will give me the smallest number based on multiple criteria.

For example, I want to find all:

1. Product A
2. 1 Liter
3. Smallest Price

In other words, out of all 1 Liter Product A's, I want to see the smallest price point.

I tried a sumproduct but I can't get it to work. Something like =sumproduct((A1:A100="Product A")*(B1:B100="1L")*(small(C1:C100,1)))

How can I get the small formula working within the sumproduct? Or is there another workaround?

Any help would be great!
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I need a formula that will give me the smallest number based on multiple criteria.

For example, I want to find all:

1. Product A
2. 1 Liter
3. Smallest Price

In other words, out of all 1 Liter Product A's, I want to see the smallest price point.

I tried a sumproduct but I can't get it to work. Something like =sumproduct((A1:A100="Product A")*(B1:B100="1L")*(small(C1:C100,1)))

How can I get the small formula working within the sumproduct? Or is there another workaround?

Any help would be great!

Would you post a 10-row worth of data?
 
Upvote 0
Create a PivotTable (Data | PivotTable and PivotChart Report...) with Product and Size as the row fields and Price as the data field. Excel will probably show Sum of Price as the value. Right-click on the data field header select 'Field Settings...' and change the Sum to Min.

You'll get the minimum prices for all products and all sizes with this single step.
I need a formula that will give me the smallest number based on multiple criteria.

For example, I want to find all:

1. Product A
2. 1 Liter
3. Smallest Price

In other words, out of all 1 Liter Product A's, I want to see the smallest price point.

I tried a sumproduct but I can't get it to work. Something like =sumproduct((A1:A100="Product A")*(B1:B100="1L")*(small(C1:C100,1)))

How can I get the small formula working within the sumproduct? Or is there another workaround?

Any help would be great!
 
Upvote 0
Hello. Here is the data. I would like a formula to find this as I will create a recurring report with this and other measures.

Product Size Price
A 1L 100
A 2L 100
A 1L 5
A 1L 100
B 1L 100
A 2L 100
B 1L 100
B 2L 100

I would like to find the smallest price for Product A, 1L, which would be 5 in the example.

Thanks for any help!
 
Upvote 0
Columns E:G shows the minimum price for each product and size using the PivotTable idea.

Columns I:J show how you can find individual minimum prices by formula. Note that the formula should be entered without the {} but confirmed with Ctrl+Shift+Enter, not just Enter, and that will insert the {} around the formula.

Excel Workbook
ABCDEFGHIJK
1ProductSizePriceMin of PriceSizeProduct of InterestA
2A1L100Product1L2LSize of Interest1L
3A2L100A5100Min Price5
4A1L5B100100
5A1L100
6B1L100
7A2L100
8B1L100
9B2L100
10
Min Price
 
Upvote 0
Perfect! Thanks much!!

Quick question, I noticed when I did not press CSE the answer was the same. Is that just an anomaly or do I need to make this a CSE formula (just clarifying because I know array formulas take extra computation power).
 
Upvote 0
Perfect! Thanks much!!

Quick question, I noticed when I did not press CSE the answer was the same. Is that just an anomaly or do I need to make this a CSE formula (just clarifying because I know array formulas take extra computation power).
Coincidence. To test, try this:

1. Change the Size of Interest to 2L
2. Click in the formula cell, press F2 then Enter. This will remove the {}.

The formula should now give you an incorrect result.
 
Upvote 0
Oh no! I need a little more help. The formula is pulling in zeros. I tried to add *(C2:C9>0) but it is still bringing in zeros. Any advice? Thanks!
 
Upvote 0
Never mind, I just added a column that put a "1" if the value was greater than zero and based a condition off that. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,842
Members
449,471
Latest member
lachbee

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