Formula to Return Most Common Instance of a Value?

jehuh

New Member
Joined
Dec 9, 2021
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hello All,

I've been trying to figure out a clean way to determine and show how frequently a cell value occurred based on another cell. Here is my example below:

For automotive spark plugs, I want to know where spark plug AC_104017 was stocked the majority of the time. The answer is warehouse 1, but i'm struggling to find an easy formula to put the result in column C. I would like to use this formula for a larger list of many different spark plugs.

1643918251096.png
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What happens in a tie?
See if this is what you want or gets you started.

Book4
ABC
1PlugWarehouse
2AC-104017location1location1
3AC-104017location1location1
4AC-104017storelocation1
5AC-104010location2truck
6AC-104010trucktruck
7AC-104010trucktruck
8AC-104017storelocation1
9AC-104017customerlocation1
Sheet2
Cell Formulas
RangeFormula
C2:C9C2=INDEX($B$2:$B$9,MODE(IF($A$2:$A$9=A2,MATCH($B$2:$B$9,$B$2:$B$9,0))))
 
Last edited:
Upvote 0
Solution
What happens in a tie?
See if this is what you want or gets you started.

Book4
ABC
1PlugWarehouse
2AC-104017location1location1
3AC-104017location1location1
4AC-104017storelocation1
5AC-104010location2truck
6AC-104010trucktruck
7AC-104010trucktruck
8AC-104017storelocation1
9AC-104017customerlocation1
Sheet2
Cell Formulas
RangeFormula
C2:C9C2=INDEX($B$2:$B$9,MODE(IF($A$2:$A$9=A2,MATCH($B$2:$B$9,$B$2:$B$9,0))))

Thank you for the quick response! In a tie, I would like default to the first instance of the cell
 
Upvote 0
Does my formula do it for you?
Yes it looks like that will work. I have have 72,000 lines of data for the formula to work through, but for a smaller sample it worked perfectly. Thank you
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
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