Vlookup (or other formula) to return multiple values in same cell

Dani_LobP

Board Regular
Joined
Aug 16, 2019
Messages
134
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm struggling to make up some formula where I can populate a cell with multiple results based on a specific value.

Idea is that I have 1 big table, where I would lookup a value, and that value would show from 1 to X rows, and from that filter lets say, there are 2 columns id like to concatenate so in the end, formula brings up in same cell, different lines with concatenations found.

visual example below, hope it makes sense :D

Vlookup ValueNumberName
3669example 1
21174example 2
41476example 3
41536example 4
81546example 5
101564example 6


Values
2formula to obtain ->1174 example 2
3formula to obtain ->669 example 1
4formula to obtain ->1476 example 3
1536 example 4

So point is that i can populate 2nd table based on data from the first table...
Hopefully someone here saw something similar and can help me with it :)

As for now is a very manual task but im sure there are some formulas i can implement to make it automatic hehe

thanks in advance.
 
At the end of the iferror use "" rather than ""
The #calc error means that the value in B2 could not be found in Col A, what sort of values are they?
just numbers... I'm using formula LEFT .. in order to extract first numbers from another column which has a number . and some text.

=IFERROR(LEFT(AA2,(FIND(".",AA2,1)-1)),"")

example of column AA format below...

402. Example blablablabla
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
In that case they are text not numbers, try
Excel Formula:
=TEXTJOIN(CHAR(10),,FILTER('Raw1'!$B$2:$B$10000& " "&'Raw1'!$E2:$E10000,'Raw1'!$A$2:$A$10000=B2&"","Not found"))
 
Upvote 0
Solution
In that case they are text not numbers, try
Excel Formula:
=TEXTJOIN(CHAR(10),,FILTER('Raw1'!$B$2:$B$10000& " "&'Raw1'!$E2:$E10000,'Raw1'!$A$2:$A$10000=B2&"","Not found"))
oh that worked! great! thanks .. hehe :D

Not sure if I understand how the B2&"" would work, but it does.. what's the logic behind that command?

Thanks again for your help :)

one last thing, would you know how to touch the formula so each concatenation is on different line in the same cell? as for now, it seems to just put them all as a bulk one after the other creating a big wall of text when there's more than 1-2... i can do the manual fix , but wonder if there's a way to avoid it :)
 
Upvote 0
It simply converts a number into text.


Just turn wrap text on.
Yeah, trying to play with wrap text on/off and making bigger cell, but seems to be a 1 long text and excel not wanting them to be split
 
Upvote 0
ok now it works, my bad.
I thought the CHAR(10) meant the number of characters to get, and i changed it to 30.. when i turned it back to 10 it works.
so its not doing what i thought it does... :)
what is it for the CHAR(10) if i may ask?

And once again thanks a lot for your help mate :)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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