Return Multiple Values in a Column after Matching Highest Number

gikaar

New Member
Joined
Sep 15, 2023
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I'm having an issue trying to figure out the formula for what I'm trying to accomplish. Here is what I'm trying to do:


Word1 1 1
Word1 2 1
Word1 3 2
Word1 4 3
Name1 1 0
Name1 2 1
Name1 3 1
Word2 1 0
Word2 2 0
Word2 3 1
Word2 4 2
Name2 1 1
Name2 2 2
Name3 3 3

I'm trying to "pull" the max number in column 3 (a) that matches the max number of column2 and column1, and then add that number to the next highest number (b) for the next match, and so on.

Word1 4 3 = a
Name1 3 1 = b
Word2 4 2 = c
Name2 3 3 = d

a+b+c+d=x

Any help would be appreciated.

Thank you.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
More clarification:

In my example, the final formula of a+b+c+d=x would be (3+1+2+3)=9. I just don't know the formula to get there.
 
Upvote 0
Welcome to the MrExcel forum!

Book1 (version 1).xlsb
ABCDEFGHIJ
1Unique NamesExcel 365
2Word111Word14399
3Word121Name131
4Word132Word242
5Word143Name233
6Name110   
7Name121   
8Name131   
9Word210   
10Word220
11Word231
12Word242
13Name211
14Name222
15Name233
Sheet5
Cell Formulas
RangeFormula
E2:E9E2=IFERROR(INDEX($A$2:$A$15,AGGREGATE(15,6,(ROW($A$2:$A$15)-ROW($A$2)+1)/(COUNTIF($E$1:$E1,$A$2:$A$15)=0),1)),"")
F2:F9F2=IFERROR(AGGREGATE(14,6,$B$2:$B$15/($A$2:$A$15=E2),1),"")
G2:G9G2=IFERROR(AGGREGATE(14,6,$C$2:$C$15/($A$2:$A$15=E2)/($B$2:$B$15=F2),1),"")
H2H2=SUM(G:G)
J2J2=LET(u,UNIQUE($A$2:$A$15),m,MAXIFS($B$2:$B$15,$A$2:$A$15,u),SUM(MAXIFS($C$2:$C$15,$A$2:$A$15,u,$B$2:$B$15,m)))


With Excel 2016, I had to use a series of formulas to get it to work. The E column creates a list of unique names, the F column finds the max value for each name from column B, the G column finds the corresponding value from column C, and the H column sums them up. The J2 formula shows how Excel 365 can do it all in a single cell. Note that both versions could have issues if the values in column B can be duplicated. Let me know if that can happen, and if so, what you want to do about it.

Also, your example showed a Name3 on the end - I assumed it was a typo for Name2.

Hope this helps!
 
Upvote 0
Thank you very much! That's exactly what I need!

And yes, the Name3 on the end was a typo.
 
Upvote 0
Perhaps your sample data is not representative of your actual data, otherwise what about this?

23 09 16.xlsm
ABCDE
1
2Word1119
3Word121
4Word132
5Word143
6Name110
7Name121
8Name131
9Word210
10Word220
11Word231
12Word242
13Name211
14Name222
15Name233
16
Sum
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(--(A2:A15<>A3:A16),C2:C15)
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,132
Members
449,098
Latest member
Doanvanhieu

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