Help with =IF ISNUMBER for combined answers

annaskarr

New Member
Joined
Feb 8, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello! I have an issue that I'd love some help on. Say Column A might contain the text "Red Apples", or it might contain "30 Oranges", or it might contain "Washingtonian Apples and Floridian Oranges", or it might contain some other stuff. If I want to make another column next to it that will search for those specific things and if it finds Apples, return "Apples", if it finds Oranges, return "Oranges", and if it finds both of those terms, return "Apples and Oranges". Is this something I can throw together with the =IF(ISNUMBER(SEARCH)) function? My current musings are in the vein of

=IF(ISNUMBER(SEARCH"*Apple*",A1)),"Apple",IF(ISNUMBER(SEARCH("*Orange*",A1)),"Orange")),IF(AND(ISNUMBER(SEARCH("*Apple*",A1)),(ISNUMBER(SEARCH("*Orange*",A1)),"Apples and Oranges")))

Can someone tell me why it's erroring out, or if there's a better/more efficient way to accomplish this?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
How about
Excel Formula:
=IF(AND(ISNUMBER(SEARCH("*Apple*",A1)),ISNUMBER(SEARCH("*Orange*",A1))),"Apples and Oranges",IF(ISNUMBER(SEARCH("*Apple*",A1)),"Apple",IF(ISNUMBER(SEARCH("*Orange*",A1)),"Orange","")))
 
Upvote 0
Solution
How about
Excel Formula:
=IF(AND(ISNUMBER(SEARCH("*Apple*",A1)),ISNUMBER(SEARCH("*Orange*",A1))),"Apples and Oranges",IF(ISNUMBER(SEARCH("*Apple*",A1)),"Apple",IF(ISNUMBER(SEARCH("*Orange*",A1)),"Orange","")))
Fluff, correctly me if I am wrong, but when using SEARCH, you don't need wildcards, right? Aren't they unnecessary?
i.e.
SEARCH("*Apple*",A1)
could just be simplified to:
SEARCH("Apple",A1)
and the same thing for all the other SEARCH functions.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,901
Members
449,097
Latest member
dbomb1414

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