If address match, return value from first row in group

superhans

New Member
Joined
Feb 21, 2019
Messages
2
Haven't been able to cobble together an answer for this from previous questions, thanks in advance to anyone who can help. Example data set follows with question below.

GroupValueOWNRSHP_IDPNT_NOPNT_MATCHADDRESS_LINE_1
250090011164701 Green
21.570601930230911164701 Green
21.170900237465NA2000 Green
350090016068820 Blue
30.8701245868609NA820 Orange
30.87012597256716068820 Blue
30.8702868674836616068820 Blue

<tbody>
</tbody>


Column 5 (PNT_MATCH) is what I want to populate using a formula, in the example I've typed in the values for illustration. I have thousands of lines of data, hence why I can't type in all needed values manually.

Each row of data belongs to a Group (column 1), and the first row of each new group has the value 500 in column 2 (Value). For all non-500 Value rows within each distinct group, I want the cell in column 5 (PNT_MATCH) to return the value from the 500 row's column 4 (PNT_NO), if the address in that given row matches the address in the 500 row. If the address does not match, NA should be returned.

So as illustrated above, the address in Row 3 matches the address in Row 2 (which is a 500 PCT_MATCH row), so the value of Row 2's PNT_NO is returned in Row 3's PNT_MATCH column (11164). The address in Row 4 does not match so NA is returned. Row 5 represents a new Group (Group 3) so the pattern repeats - Row 6's address does not match Row 5's so NA is returned, then Rows 7 and 8's addresses do match Group 3's 500 Value row so the value of Row 5's PNT_NO is returned (16068).

It doesn't matter what values are returned in 500 PCT_MATCH rows, I can filter them out. I'm sorry if I am over-explaining this, but any help would be greatly appreciated!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi & welcome to MrExcel
How about
=IF(B2=500,"",IF(F2=INDEX($F$2:$F$8,MATCH(A2,$A$2:$A$8,0)),INDEX($D$2:$D$8,MATCH(A2,$A$2:$A$8,0)),"N/A"))
 
Upvote 0
Welcome to the forum.

Assuming your headers are in row 1, and that your groups are in sorted order as shown, try this formula in E2 and drag down:

=IF(B2=500,"",IF(VLOOKUP(A2,$A$1:$F1,6,0)=F2,VLOOKUP(A2,$A$1:$F1,4,0),"NA"))
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,689
Members
449,117
Latest member
Aaagu

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