SerenityNetworks
Board Regular
- Joined
- Aug 13, 2009
- Messages
- 131
- Office Version
- 365
- Platform
- Windows
I can use the following to return the cell reference in Column-AA that has a match to the content in E2.
=SUBSTITUTE(ADDRESS(1,COLUMN(AA:AA),4),"1","")&MATCH("*"&E2&"*",AA:AA,0)
If E2 contained "fed oatmeal" and AA20 contained "Bob should be fed oatmeal twice daily" then AA20 would be returned.
But what if I have multiple occurrences of "fed daily"? Say I have: "Bob should be fed oatmeal twice daily" in AA20, "Babies should be fed oatmeal" in AA32, and "Tommy should never be fed oatmeal" in AA40. Is there a clean way to return AA20, AA32, and AA40 in a single cell?
I know I could do it by essentially concatenating the above formula to itself a bunch of times (starting the next concatenation at the row found in the previous), but it would only return a limited number of occurrences. It seems that an array formula could do it, but I'm not sure how to write it.
Any help would be appreciated.
Thanks,
Andrew
=SUBSTITUTE(ADDRESS(1,COLUMN(AA:AA),4),"1","")&MATCH("*"&E2&"*",AA:AA,0)
If E2 contained "fed oatmeal" and AA20 contained "Bob should be fed oatmeal twice daily" then AA20 would be returned.
But what if I have multiple occurrences of "fed daily"? Say I have: "Bob should be fed oatmeal twice daily" in AA20, "Babies should be fed oatmeal" in AA32, and "Tommy should never be fed oatmeal" in AA40. Is there a clean way to return AA20, AA32, and AA40 in a single cell?
I know I could do it by essentially concatenating the above formula to itself a bunch of times (starting the next concatenation at the row found in the previous), but it would only return a limited number of occurrences. It seems that an array formula could do it, but I'm not sure how to write it.
Any help would be appreciated.
Thanks,
Andrew