Forum

Notifications
Clear all

Return names

14 Posts
7 Users
0 Reactions
176 Views
(@excelguru-not)
Posts: 5
Active Member
Topic starter
 

I have 3 columns of information with headings by 3 sections down (basically a 3x3 grid of information with headings over each section) on sheet2

On Sheet1 I have a list of names where I need to search for the name in the 3x3 grid and return the heading it is under

I need to know what Heading Dianne is under.  I will also have all the names listed on Sheet1 where I need to find the corresponding heading.

Plus if John moves from Heading 1 to Heading 3, the information will be updated on sheet1

 
Posted : 23/01/2020 9:30 pm
Anders Sehlstedt
(@sehlsan)
Posts: 969
Prominent Member
 

Hello Sara,

It would be great if you can upload a sample file showing us the data and structure you have, it will be a lot easier for us to give you a valid reply.

Br,
Anders

 
Posted : 24/01/2020 4:50 pm
(@excelguru-not)
Posts: 5
Active Member
Topic starter
 

Sorry about that..please see attached file

 
Posted : 25/01/2020 6:00 pm
(@purfleet)
Posts: 412
Reputable Member
 

The layout of the data isnt great, but i have knocked up the attached with a few helper columns (these can probaly be consolidated at some point) and i have also moved the tables to the main worksheet for ease of reference but these could be moved back to the other sheet.

I am sure there other options

 

Purfleet

 
Posted : 26/01/2020 5:26 am
(@xlarruda)
Posts: 3
Active Member
 

Look this. Maybe it can help you

 
Posted : 26/01/2020 12:10 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Sara,

I'd highly recommend that your data is organised into a tabular format and create a table so that reporting and formulas can work more easily.  I've done this on Sheet3 (see attached).

You can now use VLOOKUP or XLOOKUP to return the color associated with each person's name.  However the data on Sheet1 is now just a duplicate of the table on Sheet3 so perhaps in itself isn't that useful.

You can create the reports on Sheet2 by using Pivot Tables or the FILTER function.

Regards

Phil

 
Posted : 26/01/2020 7:04 pm
(@excelguru-not)
Posts: 5
Active Member
Topic starter
 

Thanks for all your help I will try these and see if they work with my actual data.

Unfortunately the tabular format will not work as the 3x3 grid is the format that we need to use.

 
Posted : 27/01/2020 12:03 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Sara

See attached. It is a crazy ARRAY formula I modified from here:

https://www.myonlinetraininghub.com/excel-find-column-containing-a-value

Good luck

 
Posted : 28/01/2020 5:49 am
(@debaser)
Posts: 836
Member Moderator
 

This array formula is slightly shorter, but very dependent on the layout of the source data sheet! (Must start in row 1, and be 5x3 blocks with a blank row in between, as in the example):

 

=INDEX(Sheet2!A:C,INT(MAX(MMULT(TRANSPOSE(ROW(Sheet2!$A$1:$A$17)),--(Sheet2!$A$1:$C$17=A2)))/6)*6+1,MAX(MMULT(--(Sheet2!$A$1:$C$17=A2),TRANSPOSE(COLUMN(Sheet2!$A$1:$C$1)))))

 
Posted : 28/01/2020 8:27 am
(@xlarruda)
Posts: 3
Active Member
 

There was an error in the code. Please, see that. 

 
Posted : 28/01/2020 8:31 am
(@excelguru-not)
Posts: 5
Active Member
Topic starter
 

Purfleet.....yours worked up until tried to recreate the formulas to reference sheet2.

 
Posted : 28/01/2020 1:21 pm
(@purfleet)
Posts: 412
Reputable Member
 

You would need to recreate the formula's referencing the second sheet, or as a work around, paste on to a new sheet and 'paste as link' from there you can either hide any columns you don't want to see or delete them or if you want to keep the data permanently 'paste values'

See attached

 
Posted : 29/01/2020 3:01 am
(@excelguru-not)
Posts: 5
Active Member
Topic starter
 

Hi me again, formula works amazing job....question though how do I adjust the formula if I was to add 5 columns to the beginning of the information sheet (Sheet 2 ... where the boxes are)

 
Posted : 10/02/2020 12:48 pm
(@purfleet)
Posts: 412
Reputable Member
 

You want to add more colours with more names?

This is where is gets difficult with your data if you want to add more columns

=IFERROR(LEFT(CELL("address",INDEX($N$1:$P$17, MATCH($A2,$N$1:$N$17,0),1)),2), IFERROR(LEFT(CELL("address", INDEX($N$1:$P$17,MATCH($A2,$O$1:$O$17,0),2)),2), LEFT(CELL("address", INDEX($N$1:$P$17, MATCH($A2,$P$1:$P$17,0),3)),2)))

Each 'iferror' highlighted above is checking for the name in each column, so it looks in N and if not found, looks in O and then P, as soon as it finds the name it stops, therefore if you want to add more names and columns you will need to add the highlighted part for each additional column.

=IFERROR(LEFT(CELL("address", INDEX($N$1:$N$17,MATCH($A2,$N$1:$N$17,0),1)),2), IFERROR(LEFT(CELL("address", INDEX($O$1:$O$17, MATCH($A2,$O$1:$O$17,0),1)),2), IFERROR(LEFT(CELL("address", INDEX($P$1:$P$17, MATCH($A2,$P$1:$P$17,0),1)),2),"")))

Above i have simplified the formula slightly so you can see in the first iferror column N is referenced, and the second is O and so on, copy the part in red and paste it in at the end of the formula just before the double quotes and then change the column it is looking at (q in my example)

You will also need to do the same thing in the row column

=IFERROR(MATCH($A10,$N$1:$N$18,0), IFERROR(MATCH($A10,$O$1:$O$18,0), IFERROR(MATCH($A10,$P$1:$P$18,0), IFERROR(MATCH($A10,$Q$1:$Q$18,0),""))))

 
Posted : 13/02/2020 6:12 pm
Share: