Advanced vlookup?

Spaztic

New Member
Joined
Jul 27, 2023
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hello, new to the forum and needing some help!

I have attached an image to help explain what I'm attempting to do.
  • For the values shown in columns A through E, I want to look up what colors are assigned to each of them (columns J through O) and return the results in column G
  • For any values shown in columns A through E that do not show up in the table (columns J through O), column G should be left blank
  • NOTE: There may be more than 1 color for each value so column G may show more than 1 (e.g. Red, Yellow)

I really appreciate any help you can provide me!
 

Attachments

  • Picture1.png
    Picture1.png
    43 KB · Views: 18

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Put this array formula (entered using Ctrl+Shift+Enter instead of Enter ... which puts curly brackets around the formula if successfully entered), in cell G2, and copy down:

=IF(ISNA(MATCH(TEXTJOIN("",TRUE,A2:F2),$J$2:$J$5,0)),"",TEXTJOIN(",",TRUE,IF(OFFSET($K$1,MATCH(TEXTJOIN("",TRUE,A2:F2),$J$2:$J$5,0),0,1,5)="x",$K$1:$O$1,"")))
 
Upvote 0
Welcome to the MrExcel board!

Assuming that columns A:E & J are text values (eg B4 and J2 are both "1.2" not the number 1.2) then you could try this

23 08 01.xlsm
ABCDEFGHIJKLMNO
1Color(s)RedYellowBlueGreenOrange
21 1.2x
31.1 1.2.1xx
41.2Red1.2.2.1x
51.2.1Yellow, Green2.2x
61.2.2 2.2.1xx
71.2.2.1Orange2.2.2.1xx
82 2.2.2.2x
92.1 2.2.2.2.1x
102.2 
112.2.1Blue, Green
122.2.2 
132.2.2.1Yellow, Orange
142.2.2.2Red
152.2.2.2.1Green
Which colours
Cell Formulas
RangeFormula
G2:G15G2=IFNA(TEXTJOIN(", ",1,FILTER(K$1:O$1,INDEX(K$2:O$9,MATCH(CONCAT(A2:E2),J$2:J$9,0),0)="x","")),"")


An alternative is to put this formula in G2 and it will populate all the rows from that single formula without needing to copy down the column.

23 08 01.xlsm
ABCDEFGHIJKLMNO
1Color(s)RedYellowBlueGreenOrange
21 1.2x
31.11.2.1xx
41.2Red1.2.2.1x
51.2.1Yellow, Green2.2x
61.2.22.2.1xx
71.2.2.1Orange2.2.2.1xx
822.2.2.2x
92.12.2.2.2.1x
102.2
112.2.1Blue, Green
122.2.2
132.2.2.1Yellow, Orange
142.2.2.2Red
152.2.2.2.1Green
Which colours (2)
Cell Formulas
RangeFormula
G2:G15G2=BYROW(A2:E15,LAMBDA(rw,IFNA(TEXTJOIN(", ",1,FILTER(K$1:O$1,INDEX(K$2:O$9,MATCH(CONCAT(rw),J$2:J$9,0),0)="x","")),"")))
Dynamic array formulas.


@GlennUK
Some comments about your suggestion
- It is simpler to use CONCAT instead of TEXTJOIN with "" as the delimiter
- Your profile does not say which version you are using, but note that the OP has 365 and in that version Ctrl+Shift+Enter is not required.
 
Upvote 0
Solution

Forum statistics

Threads
1,216,001
Messages
6,128,211
Members
449,435
Latest member
Jahmia0616

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