INDEX MATCH Non-Blank Cell

redhots4

Board Regular
Joined
Aug 30, 2004
Messages
136
Office Version
  1. 365
Platform
  1. MacOS
I have a list of names where each name is repeated multiple times, with values in only certain columns to the right. An example is shown below. I want to use a formula (INDEX, MATCH?) To return a clean data set without duplicates as shown in the second table. Any help?

Starting Point:
NameAgeHeightWeight
John Smith32
John Smith61
John Smith185
Amy Miller35
Amy Miller56
Amy Miller115

Desired End Point:
NameAgeHeightWeight
John Smith3261185
Amy MIller3556115
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
If each value (Age, Height, and Weight) only appears once per person, why not just use Subtotals, grouping on the name field?
Or perhaps a Pivot Table?
 
Upvote 0
as long as the columns stay in the same order, this should work for you
--------------------
Book1
ABCDEFGHIJ
1NameAgeHeightWeightAgeHeightWeight
2John Smith32John Smith3261185
3John Smith61Amy Miller6118535
4John Smith185
5Amy Miller35
6Amy Miller56
7Amy Miller115
Sheet1
Cell Formulas
RangeFormula
H2:J3H2=TOROW(B2:D4,1)
Dynamic array formulas.
 
Upvote 0
Perhaps this, the below gets the data organised and strips out the blanks

=FILTER(B2:D7&"",(B2:B7<>0))&FILTER(B2:D7&"",(C2:C7<>0))&FILTER(B2:D7&"",(D2:D7<>0))

@Joe4 Is there a way to use the FILTER function to achieve what I have above by not repeating the FILTER function using & ?

I tried =FILTER(B2:D7&"",(B2:B7<>0)+(C2:C7<>0)+(D2:D7<>0)) but this returned the data in its original format, though this would strip out the blanks...
 
Upvote 0
I am sure someone can make it fully spill but in the meantime:

Book6
ABCDEFGHIJ
1NameAgeHeightWeightNameAgeHeightWeight
2John Smith32John Smith3261185
3John Smith61Amy Miller3556115
4John Smith185
5Amy Miller35
6Amy Miller56
7Amy Miller115
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=UNIQUE($A$2:$A$7)
H2:J3H2=BYCOL(FILTER($B$2:$D$7,$A$2:$A$7=G2,""),LAMBDA(cols,SUM(cols*(--cols<>""))))
Dynamic array formulas.
 
Upvote 0
What version of Excel are you actually using? Your profile shows 2016 which does not have the filter function.

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Apologies, I didn't think it was possible to select two versions, I have 2016 at home, but where I am currently working the client has 365.

Profile updated
 
Upvote 0
multiple posts solutions-v3.xlsm
ABCDEFGHI
1NameAgeHeightWeightJohn Smith3261185
2John Smith32Amy Miller3556115
3John Smith61
4John Smith185
5Amy Miller35
6Amy Miller56
7Amy Miller115
match non-blank cells
Cell Formulas
RangeFormula
F1:F2F1=UNIQUE($A$2:$A$7)
G1:I2G1=WRAPROWS(TOROW(FILTER($B$2:$D$7,$A$2:$A$7=F1,""),1),COUNTA($B$1:$D$1))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,321
Members
449,218
Latest member
Excel Master

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