Returning more than one value to the same cell.

rickblunt

Well-known Member
Joined
Feb 18, 2008
Messages
609
Office Version
  1. 2019
Platform
  1. Windows
Hello, I need to scan a column of numbers for a target value and then pass the values from the column to the left of the found targets to a cell. I normally do this with a list box in a userform but this time I need to do it in a worksheet cell instead.

I am scanning column B for the values. (numbers).
I want to return the found values from column A (text).
The number in "H4" is my target value.

I can use this formula to find the first occurrence, but how do I change the formula to get multiples to show up in the same cell? I do not know if I use the count function or the index or something like that.

For this example I have the formula in C1

Excel Formula:
=IF(B19<=H4,A19,"")

I appreciate any thoughts - thanks
 
As long as col B is real numbers & not text ("45" is text & not a number) the formula I supplied should work. You also need to leave the "" as is, or you will get None returned for every row which does not fit the criteria.
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Did you try Fluff's suggestion?
It looks like he came with an array formula that will do what you want.
bam - bam - bam (the sound of my head hitting my desk) Thank you to both of you for the solution, Fluff for the formula and Joe4 for pointing out that its an array formula, which revealed that I was trying to put this in a merged cell which is also not allowed... Many thanks once again to both of you for another lesson...
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,881
Messages
6,122,074
Members
449,064
Latest member
MattDRT

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