Howdy all
I was hoping someone would be able to help me. With help from this board, I was able to create a formula that displayed one of 3 conditions based on comparing columns. I am looking to do something similar finding text in a single column and updating a different column based on what it finds.
I tried adapting the formula, but it looks far too complex for me and I am thinking it's more appropriate in a macro. So what I am looking to do is to look at Column A's cell contents for many possible words and update the corresponding Column D cells.
So it looks for "apple", "orange", or "pear" and if found it updates with "yummy apples", "lots of oranges", "we gots pears", or blank.
__A_________________D_____
apple__________yummy apples
orange_________lots of oranges
apples here_____yummy apples
I hate pears_____we gots pears
watermelon_____
kiwi____________
candy apples____yummy apples
- If A1 contains "apple", it sets the contents of D1 to "yummy apples"
- If A2 contains "orange", it sets the contents of D2 to "lots of oranges"
- If A5 contains none of the words, it sets D5 blank.
- If A7 contains "candy apple", it sets the contents of D7 to "yummy apples"
- Etc
I had started with a simple formula (below), but I couldn't think of a good way to nest one into another into another without a big confusing mess. I thought rewriting as a macro, looping per line, would be easier. But beyond the basic conditional If Then, I don't know how to find or update in this way.
=IF(ISERROR(FIND("apple",A1, 1)), "", "yummy apples")
If anyone has a moment and a suggestion, I'd appreciate it!
-Kyote
I was hoping someone would be able to help me. With help from this board, I was able to create a formula that displayed one of 3 conditions based on comparing columns. I am looking to do something similar finding text in a single column and updating a different column based on what it finds.
I tried adapting the formula, but it looks far too complex for me and I am thinking it's more appropriate in a macro. So what I am looking to do is to look at Column A's cell contents for many possible words and update the corresponding Column D cells.
So it looks for "apple", "orange", or "pear" and if found it updates with "yummy apples", "lots of oranges", "we gots pears", or blank.
__A_________________D_____
apple__________yummy apples
orange_________lots of oranges
apples here_____yummy apples
I hate pears_____we gots pears
watermelon_____
kiwi____________
candy apples____yummy apples
- If A1 contains "apple", it sets the contents of D1 to "yummy apples"
- If A2 contains "orange", it sets the contents of D2 to "lots of oranges"
- If A5 contains none of the words, it sets D5 blank.
- If A7 contains "candy apple", it sets the contents of D7 to "yummy apples"
- Etc
I had started with a simple formula (below), but I couldn't think of a good way to nest one into another into another without a big confusing mess. I thought rewriting as a macro, looping per line, would be easier. But beyond the basic conditional If Then, I don't know how to find or update in this way.
=IF(ISERROR(FIND("apple",A1, 1)), "", "yummy apples")
If anyone has a moment and a suggestion, I'd appreciate it!
-Kyote