Search column A for value x, if present, return corresponding value in column B

Iluvexcel123

New Member
Joined
Dec 1, 2015
Messages
16
Hello,

I'm trying to asking Excel to search all values in a particular column for a specific number, and if that number is found, produce the result in the corresponding row in a separate column. I hope the formatting of the example below is clear enough to show the desired results. Thanks for your help!

Note 1: The results will display on a different worksheet.
Note 2: I don't want any blank cells before the first value found (blank cells at the end of the list are okay)

Raw Data: DESIRED RESULTS:

House NumberCharacteristicsHouse 1House 2House 3House 4
11 garage1 garage3 bedrooms2 garages6 windows
12 full bath2 full bath1 basement3 full bath4 bedrooms
11 half bath1 half bath1 half bath
23 bedrooms5 bedrooms
21 basement
32 garages
33 full bath
31 half bath
35 bedrooms
46 windows
44 bedrooms

<tbody>
</tbody>
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Assuming that your data is in Sheet 1 range A1:B12 and your desired results in Sheet 2 with the house numbers in cells A1:D1, try this:

*ABCD
1House 1House 2House 3House 4
21 garage3 bedrooms2 garages6 windows
32 full bath1 basement3 full bath4 bedrooms
41 half bath*1 half bath*
5**5 bedrooms*

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
A2{=IFERROR(INDEX(Sheet1!$B$2:$B$12,SMALL(IF(Sheet1!$A$2:$A$12=(RIGHT(Sheet2!A$1,LEN(Sheet2!A$1)-SEARCH(" ",Sheet2!A$1))*1),ROW(Sheet1!$A$2:$A$12)-ROW(Sheet1!$A$2)+1),ROW(1:1))),"")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

The formula takes into account that you have text "House 1", "House 2" etc and not just 1,2 etc. I accounted for this difference in data with the following : =RIGHT(Sheet2!A$1,LEN(Sheet2!A$1)-SEARCH(" ",Sheet2!A$1))*1

Apply the formula down until it becomes blank and to the right for the 4 houses. Don't forget to adjust the range to your actual range. You can have a closer look at the formula here: Vlookup Multiple Values - Return MULTIPLE corresponding values for ONE Lookup Value
 
Upvote 0
Thank you so much for your quick response! I see the instruction to do the CNTRL SHIFT ENTER. I should have mentioned that the worksheet where the results are displayed is a template created and provided by my employer. It has merged cells (which need to remain merged), and I get an error message when I try to use the CNTRL SHIFT ENTER. The error message says it can't be used with merged cells. Is there a way around this?
 
Upvote 0
Personally, I would just unmerge the cells and never again merge them (but hey I might be the only one traumatized by merged cells). An alternative would be to write the formula in a non-merged cell, let's say AA2. then in your merged cell, type in =AA2 and do the same for every merged cell you want the formula in. Alternatively, you can have a look at this article How to enter array formulas in merged cells | Get Digital Help - Microsoft Excel resource. Or even try googling some more options. I avoid merged cells at all costs so I am not very familiar with the issue.
 
Upvote 0

Forum statistics

Threads
1,215,337
Messages
6,124,340
Members
449,155
Latest member
ravioli44

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