Multiple If/then formula if contains

squeakums

Well-known Member
Joined
May 15, 2007
Messages
851
Office Version
  1. 365
I have this basic formula:

=IF(cell="text", value_to_return, "").

Id like to write a formula that is more like =if(cell="FINRA" and "man", "Leadership), if(cell="FINRA" and <> "man", then "Execution", if(cell=<>"Finra" and "Manager, "leadership), if(cell="executive assistant", "admin") otherwise "Execution".

How would I write this multiple if/then statement for containing words please?
 
I think rather than trying to write a long, complex Excel function to do this, I would create a User Defined Function in VBA, which then can be used like any other Excel function, to do it.
Are you open to that kind of solution (one that makes use of VBA)?
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I think rather than trying to write a long, complex Excel function to do this, I would create a User Defined Function in VBA, which then can be used like any other Excel function, to do it.
Are you open to that kind of solution (one that makes use of VBA)?
I can write some vba code for this but was seeing if the formula was possible.
 
Upvote 0
Easiest way I can think of is to make a lookup matrix.
Book1
ABCDEFG
1If Contains this in the cell D2If it finds this contain what formula producesField D2 its searching for textIf formula was in this cell what it would produce; ResultsFormulaCheck
2"FINRA" and "man"FINRA - LeadershipRooms to Go - FINRA-ManagerFINRA - LeadershipFINRA - LeadershipTRUE
3"FINRA", <> "man"FINRA - ExecutionRooms to Go - FINRA AssociateFINRA - ExecutionFINRA - ExecutionTRUE
4Filter FINRA out, then search ManagerLeadershipRooms to Go - ManagerLeadershipLeadershipTRUE
5Executive AssistantAdminShopping Executive AssistantAdminAdminTRUE
6Manager-FINRAFINRA - LeadershipSPOC Manager-FINRAFINRA - LeadershipFINRA - LeadershipTRUE
7OfficerLeadershipFinancial OfficerLeadershipLeadershipTRUE
8"FINRA" and "Leader"FINRA - LeadershipSPOC FINRA - LeaderFINRA - LeadershipFINRA - LeadershipTRUE
9Administrative AssistantAdminSPOC Administrative AssistantAdminAdminTRUE
10If not of the above thenExecutionRooms to Go EmployeeExecutionExecutionTRUE
11
12
13FINRAmanleaderofficerExecutive AssistantAdministrative Assistant
14manFINRA - LeadershipLeadership
15leaderFINRA - LeadershipLeadership
16FINRAFINRA - ExecutionFINRA - LeadershipFINRA - Leadership
17officerLeadership
18Executive AssistantAdmin
19Administrative AssistantAdmin
Sheet5
Cell Formulas
RangeFormula
E2:E10E2=IFERROR(TAKE(UNIQUE(TOROW(IF(SEARCH($B$13:$G$13,C2)*SEARCH($A$14:$A$19,C2),$B$14:$G$19),2),1),,1),"Execution")
F2:F10F2=E2=D2
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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