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.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product Number[/TD]
[TD]Price[/TD]
[TD]Most Common[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]5678[/TD]
[TD]3[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3456[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3456[/TD]
[TD]3[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3456[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]7890[/TD]
[TD]5[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]7890[/TD]
[TD]6[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
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.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product Number[/TD]
[TD]Price[/TD]
[TD]Most Common[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]5678[/TD]
[TD]3[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]9012[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3456[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3456[/TD]
[TD]3[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3456[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]7890[/TD]
[TD]5[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]7890[/TD]
[TD]6[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]