Index match first value that contains "@"

Creese11

New Member
Joined
Aug 23, 2018
Messages
3
Hey,
First time posting.

I have a data set with duplicate account keys and values in the form of email addresses.
I need to create a consolidated data set that has only one account key and a corresponding email value.
My issue is this -- some of the duplicate account keys have blanks or "old account" listed in the value section, while others have email addresses. I want to pull only the addresses using the partial match of "*@*".

I have to imagine this is an array formula that could work similar to the one that Index matches the first non-blank value.

Formula suggestions would be perfect, but I'm also open to suggestions on if VBA, Power BI, Power Query, etc would be better options

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
[TABLE="width: 189"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Account[/TD]
[TD] Owner[/TD]
[/TR]
[TR]
[TD="align: right"]1 [/TD]
[TD] Joe@gmail.com[/TD]
[/TR]
[TR]
[TD="align: right"]2 [/TD]
[TD] old account[/TD]
[/TR]
[TR]
[TD="align: right"]3 [/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1 [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]2 [/TD]
[TD] old account[/TD]
[/TR]
[TR]
[TD="align: right"]3 [/TD]
[TD] Tim@gmail.com[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Also would add that it won't always say "old account" .... could be any number of things like "stopped", "old", "closed", etc
 
Upvote 0
one way is a simple query,
Code:
SELECT  DISTINCT Account, Owner
FROM [YourSheetName$]
WHERE Owner LIKE '%@%'
Would that be OK?
 
Last edited:
Upvote 0
Can we suppose that we don't want to list accounts which do not have an owner with "@"?

In case the question is confusing...


Book1
ABCD
1AccountOwneraccowner
21Joe@gmail.com1Joe@gmail.com
32old account3Tim@gmail.com
43
51
62old account
73Tim@gmail.com
Sheet1


In C2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($A$2:$A$7,SMALL(IF(FREQUENCY(IF($A$2:$A$7<>"",IF(ISNUMBER(SEARCH("@",$B$2:$B$7)),MATCH($A$2:$A$7,$A$2:$A$7,0))),ROW($A$2:$A$7)-ROW($A$2)+1),ROW($A$2:$A$7)-ROW($A$2)+1),ROWS($C$2:C2))),"")

In D2 control+shift+enter, not just enter, and copy down:

=IF(C2="","",INDEX($B$2:$B$7,MATCH(C2,IF(ISNUMBER(SEARCH("@",$B$2:$B$7)),$A$2:$A$7),0)))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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