I would like to enter information in a cell based on the text contained in a different cell. Specifically, if a cell in column A contains text that includes "insurance," "retirement," or "401K," then I want to place an "x" in its respective cell in Column B. If not, then cell B1 should be empty. The text needs to be contained within the cell, but does not need to be the exact text. E.g., an "x" would still be placed in the column next to "life insurance" or "insurance," "whole life insurance," etc.

E.g.,

Column A        Column B
Life Insurance  x
Securities
Retirement      x

I tried to use the following formula, but am getting an error message when I do so:

IF(OR(ISNUMBER(SEARCH("insurance",A1,"retirement",A1, "401K",A1)),"x", "")

Any thoughts?

有帮助吗?

解决方案

This formula should help:

=IF(OR(ISNUMBER(FIND("Insurance",A1)),ISNUMBER(FIND("Retirement",A1)),ISNUMBER(FIND("401K",A1))),"x","")

EDIT:

I came up with an array formula that I like a little better. Hope this helps:

=IF(COUNT(MATCH({"*Insurance*","*Retirement*","*401K*"},A1,0))>0,"x","")

This will require pressing CTRL + SHIFT + ENTER instead of just ENTER after putting it in the cell because it's an array formula.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top