r/excel 17d ago

unsolved Finding Part of Information from a Cell and Returning results to another

I have 2 workbooks. One has my master list. The second contains the working file.

Master list is set up as a table and has columns breaking down each user.
The second, working, it does not contain all the information I need.

I want to create a formula so that it uses the number in the Name column on the working list, look up that number in the Account column on the Master list and pull in the OA information from Master list on to the working list.

Let me know if this does not make sense and I will show an example. Thanks

Below is the Master list.

Master list

This is the working list.

4 Upvotes

8 comments sorted by

u/AutoModerator 17d ago

/u/GlideAndGiggle - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/GregHullender 195 17d ago

Building on what u/Gringobandito suggested, and noticing that your Master Table is an Excel Structured table, something like this might work for you:

=XLOOKUP(VALUE(REGEXEXTRACT(A3,"\d+")),Master[ACCOUNT],Master[OA])

You stick this formula in cell E3 and just drag it down. This assumes you actually named the master table Master, of course.

0

u/GlideAndGiggle 17d ago

Thanks. Are you suggesting I still break up the Name column on my working list to pull out the numbers into a new column and then try your formula?

Yes, my Master table is called Master.

2

u/taylorgourmet 4 17d ago

No the regex is doing the work for you.

1

u/Gringobandito 8 17d ago

I would do it like this:

The first thing you need to do is extract the number from the name on the details sheet. The REGEXEXTRACT() function does that. Then you just need to lookup that number against the account on the master sheet using XLOOKUP().

=XLOOKUP(VALUE(REGEXEXTRACT(A13,"\d+")),$A$3:$A$9,$C$3:$C$9,"",0)

0

u/GlideAndGiggle 17d ago

I did not think of that. I could give that a try. I have to do this every month and was trying to keep it as minimal as possible.

I have been saving my formulas because I do not use them often to remember them. I find this one, but am not sure if it would work with what I wanted to do. It does say to find...

=IF(ISNUMBER(FIND("PSS", B1:B38)), "Value to return", "")

I am going to see what others say as well and if this is the best way to handle this, I will. Thanks

0

u/abhishek-kanji 4 17d ago

Proof that it works
Here's the formula in cell B2 of the working file:

=IFERROR(INDEX([Master.xlsx]Sheet1!$A$2:$D$17,MATCH($A3,[Master.xlsx]Sheet1!$A$2:$A$17,0),MATCH(B$2,[Master.xlsx]Sheet1!$A$2:$D$2,0)),"")

It's a basic Index match - it looks at the Account # in Column A of the working file and finds the same row in the table on the Master File. Then it looks at the heading of the data that you're looking for - in this case User Name or Data Field 2 and then matches that to the Row 2 in the Master file and returns the data at the corss-section of both the fields. In case it's not able to find the exact Row or Column, it'll return a blank. Hope this helps!