If statement that can search for a specific value and textjoin data from another column in a row on another sheet

bd1985

New Member
Joined
Feb 28, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am completely new to this so apologies if there is an easy answer or maybe you can point me in the right direction.
Basically I have 2 sheets that have data HW Sheet and Components Sheet. I want to pull data from rows based on a match from Column D of the Components Sheet to Column D of the HW sheet where there is a match and textjoined with line breakups in the same cell.

* HW Sheet - Column A is the main value we want to look for on Column A of the Components Sheet (1.0, 2.0 etc)
* If there are matches (usually multiple) then I want to pull data from Column E where it's row has a match based on column A of the components sheet, broken up line by line using TEXTJOIN(CHAR(10) in Column D of HW Sheet

I hope I have explained this well enough, but have also provided pictures. I have tried various types of textjoin, if and isnumber but completely lost.
 

Attachments

  • Components Sheet.JPG
    Components Sheet.JPG
    79.8 KB · Views: 30
  • HW sheet.JPG
    HW sheet.JPG
    85.7 KB · Views: 25

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

See how something like this goes. I have assumed that column A of both sheets is formatted Text.

bd1985.xlsm
ABCDE
1
21.01x SR
31.01x MP
41.01x CB
51.01x TS
62.03x BP
72.02x BBQP
82.01x HC
93.05x RS
103.02x HC
113.04x BW
Components


bd1985.xlsm
ABCD
1
21.01x SR 1x MP 1x CB 1x TS
31.0.1 
41.5.1 
52.03x BP 2x BBQP 1x HC
63.05x RS 2x HC 4x BW
BW
Cell Formulas
RangeFormula
D2:D6D2=TEXTJOIN(CHAR(10),,FILTER(Components!E$2:E$100,Components!A$2:A$100=A2,""))
 
Upvote 1
Solution
Basically I have 2 sheets that have data HW Sheet and Components Sheet. I want to pull data from rows based on a match from Column D of the Components Sheet to Column D of the HW sheet where there is a match and textjoined with line breakups in the same cell.
Here you say Column D
* If there are matches (usually multiple) then I want to pull data from Column E where it's row has a match based on column A of the components sheet, broken up line by line using TEXTJOIN(CHAR(10) in Column D of HW Sheet
Here you say Column E

I am confused.
 
Upvote 0
Col D is the for the match, col E is where to pull the data from. ;)
 
Upvote 0
I thought Column A to be matched (1.0, 2.0...). My English is getting rusty with age.
 
Upvote 0
My English is getting rusty with age.
Nope I just read what you had quoted, rather the the op & misunderstood what it was saying. It should indeed be From col E To col D.
 
Upvote 0
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

See how something like this goes. I have assumed that column A of both sheets is formatted Text.

bd1985.xlsm
ABCDE
1
21.01x SR
31.01x MP
41.01x CB
51.01x TS
62.03x BP
72.02x BBQP
82.01x HC
93.05x RS
103.02x HC
113.04x BW
Components


bd1985.xlsm
ABCD
1
21.01x SR 1x MP 1x CB 1x TS
31.0.1 
41.5.1 
52.03x BP 2x BBQP 1x HC
63.05x RS 2x HC 4x BW
BW
Cell Formulas
RangeFormula
D2:D6D2=TEXTJOIN(CHAR(10),,FILTER(Components!E$2:E$100,Components!A$2:A$100=A2,""))
Thank you so much Peter_SSs

This works perfectly! I will remember XL2BB for next time to make it easier for everyone. Apologies to others on the thread if my request wasn't clear, I may have over thought my explanation and may have caused confusion.

Thank you again!!!
 
Upvote 0
You're welcome. Glad to help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,892
Messages
6,175,236
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