If blank, find next matching data set and fill in the blanks

CascadeDiver

Board Regular
Joined
Apr 10, 2020
Messages
65
Office Version
  1. 2016
Platform
  1. Windows
Hi all,
I have a dataset with three sections: NAME, ID, GROUP.
There are multiple occurrences of each name in each group, though not always.
The ID field only has data in the last occurrence of each name per group.
(Note that each name may not have the same ID in the next or any other group)

I am looking to fill in the missing IDs
Any help would be greatly appreciated. Thanks

NameIDGroupMissing ID
BobA
JohnA
KimA
LayneA
BobA
JohnA
KimA
BobA
JohnA
KimA
LayneA
Bob1A
John2A
Kim3A
Layne4A
BobB
BobB
JohnB
BobB
JohnB
Bob15B
John17B
BobC
SarahC
Bob4C
John7C
MarkC
Kim5C
Mark8C
LauraC
Sarah6C
Laura9C
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Will this work for you:
20241227 Fill Up Matching Value CascadeDiver.xlsx
ABCD
1NameIDGroupMissing ID
2BobA1
3JohnA2
4KimA3
5LayneA4
6BobA1
7JohnA2
8KimA3
9BobA1
10JohnA2
11KimA3
12LayneA4
13Bob1A1
14John2A2
15Kim3A3
16Layne4A4
17BobB15
18BobB15
19JohnB17
20BobB15
21JohnB17
22Bob15B15
23John17B17
24BobC4
25SarahC6
26Bob4C4
27John7C7
28MarkC8
29Kim5C5
30Mark8C8
31LauraC9
32Sarah6C6
33Laura9C9
Sheet1
Cell Formulas
RangeFormula
D2:D33D2=LOOKUP(2,1/(($A$2:$A$33=A2)*($C$2:$C$33=C2)),$B$2:$B$33)
 
Upvote 0
That seems to retrieve some but not all the missing data. I am returning several 0s throughout.
 
Upvote 0
I think I figured out a way that takes some sorting, helper columns, and VLOOKUP
Creating a helper column and making a numerical group to use instead of the letter group
Create a helper column to CONCAT numerical group and name
Sort ID small to large
Sort Numeric group small to large
Missing ID formula
=VLOOKUP([@CONCAT],[CONCAT]:[ID],2,FALSE)

then paste values

NameCONCATIDGroupMissing IDGroup num
BobGroup001Bob1A1Group001
JohnGroup001John2A2Group001
KimGroup001Kim3A3Group001
LayneGroup001Layne4A4Group001
BobGroup001BobA1Group001
JohnGroup001JohnA2Group001
KimGroup001KimA3Group001
LayneGroup001LayneA4Group001
BobGroup001BobA1Group001
JohnGroup001JohnA2Group001
KimGroup001KimA3Group001
BobGroup001BobA1Group001
JohnGroup001JohnA2Group001
KimGroup001KimA3Group001
LayneGroup001LayneA4Group001
BobGroup002Bob15B15Group002
JohnGroup002John17B17Group002
BobGroup002BobB15Group002
BobGroup002BobB15Group002
JohnGroup002JohnB17Group002
BobGroup002BobB15Group002
JohnGroup002JohnB17Group002
BobGroup003Bob4C4Group003
KimGroup003Kim5C5Group003
SarahGroup003Sarah6C6Group003
JohnGroup003John7C7Group003
MarkGroup003Mark8C8Group003
LauraGroup003Laura9C9Group003
BobGroup003BobC4Group003
SarahGroup003SarahC6Group003
MarkGroup003MarkC8Group003
LauraGroup003LauraC9Group003
 
Upvote 0

Forum statistics

Threads
1,225,637
Messages
6,186,135
Members
453,340
Latest member
Stu61

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