Forum Discussion

khjhzw's avatar
khjhzw
Copper Contributor
Mar 09, 2022
Solved

How can I select cells in the column right next to, but in the same rows as the search results?

Hello,

 

I was wondering how I can select all the cells that are in the column right next to and, at the same time, are in the same row(s) as the "search result cells". By "search result cells", I mean the all the cells that are selected by a search result.

 

For example, suppose I have following table, I want to copy every entry in column A that are in the same rows as the cells with the entry "cat" in the column B, and paste them to the corresponding cells (in the same row) in the column C. In other words, I want to select "random input 1" and "random input 4" in column A by searching "cat" entries in the column B, and then paste them in column C so that cell C1 will have the entry of "random input 1" and C4 will have the entry of "random input 4".

 

 

 

 ABC
1random input 1cat 
2random input 2dog 
3random input 3dog 
4random input 4cat 
5random input 5dog 

 

 

Please pardon my long wording. If anything I tried to explain or deliver is unclear, please let me know. I will try to make it even more clear.

 

Thank you for your help!

 

Kang

4 Replies

  • mtarler's avatar
    mtarler
    Silver Contributor

    I think your best is
    a) use a formula in column C like: =IF (B2="cat", A2, "") and fill down

    • khjhzw's avatar
      khjhzw
      Copper Contributor
      Thank you so much for your help!
      This is exactly what I was looking for.
      • mtarler's avatar
        mtarler
        Silver Contributor
        actually scratch the second as it doesn't work on multiple areas (I tested it on a continuous section). I thought there was a way to do that but will have to search to see if it possible.
        meanwhile go with option a)
        i will edit msg to prevent confusion

Resources