Most common price associated with a product

joshbjames

New Member
Joined
Jul 25, 2017
Messages
33
This is similar to a question I have asked before. Basically, I have a list of products and the product number repeats on a new row for every price variance we have sold it for. I would like to find the price we have sold it for most frequently.

Variables to account for would be:
1 - It has only been sold at one price. (Return that value).
2 - Two different prices occur the exact same amount of times. (Return the lowest of the 2 prices).
3 - No particular price occurred more than another (Return the lowest price).

Here is some sample data with as many scenarios I could think of and the result I'd like.

Product NumberPriceMost Common
123422
123422
123412
567833
901244
901254
901244
901254
901234
345622
345632
345642
789055
789065

<tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Care to state per record which of the rules (Rule-1, Rule-2, and Rule-3) applies (in order to determine "most common" price?
 
Upvote 0
1234 - One price occurs most often, return that price.
5678 - Only one price exists, return that price.
9012 - The two most frequent prices occur the same amount of times, return the lower of the two.
3456 & 7890 - All the prices are different, return the lowest.
 
Upvote 0
1234 - One price occurs most often, return that price.
5678 - Only one price exists, return that price.
9012 - The two most frequent prices occur the same amount of times, return the lower of the two.
3456 & 7890 - All the prices are different, return the lowest.

Thanks. The following seems to cover above rules. It needs more testing though...

In C2 control+shift+enter, not just enter, and copy down:

=IF(COUNT(MODE.MULT(IF($A$2:$A$15=$A2,$B$2:$B$15)))>1,MIN(MODE.MULT(IF($A$2:$A$15=$A2,$B$2:$B$15))),IFERROR(MODE(IF($A$2:$A$15=$A2,$B$2:$B$15)),MIN(IF($A$2:$A$15=$A2,$B$2:$B$15))))
 
Upvote 0
Thanks, I will try this first thing in the morning and let you know! I tend to explain things in the most complicated way.

The basic idea is - Find the most frequent price. If nothing is more frequent return the lowest option. If two or more values tie for most frequent return the lowest (hopefully, that clarifies things).
 
Upvote 0
The basic idea is - Find the most frequent price. If nothing is more frequent return the lowest option. If two or more values tie for most frequent return the lowest (hopefully, that clarifies things).

Hi!

Try the Array Formula below too:

In C2 and copy down - use Ctrl+Shift+Enter to enter the formula

=IFERROR(MIN(MODE.MULT(IF($A$2:$A$15=A2,$B$2:$B$15))),MIN(IF($A$2:$A$15=A2,$B$2:$B$15)))


ABCD
1Product NumberPriceMost Common
2123422
3123422
4123412
5567833
6901244
7901254
8901244
9901254
10901234
11345622
12345632
13345642
14789055
15789065
16
****************************************

<tbody>
</tbody>


Markmzz
 
Upvote 0
Thank you both so much! These were both helpful. You all helped me solve a problem that has been plaguing us at work for a very long time.
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,005
Members
449,203
Latest member
Daymo66

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