Alternative to nested IF Formula

Mansel

New Member
Joined
Nov 17, 2006
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I wonder if anyone is able to offer an alternative to this nested if formula. The actual spreadsheet I am supplied with has 2,500 rows so this would never work, but thought it the best way to display what it is I am trying to achieve. Many thanks for any help offered.

Test Formula 3.xlsx
ABCDEFG
1Keyword to search forResult to display if foundDescription as supplied to meNested IF being used
2OwnerOwner/FounderHR Operations and Rewards Manager Spain&PortugalHR
3Co FounderOwner/FounderHR Operations and Rewards Manager Spain&PortugalHR
4DirectorDirectorVP Operations, IT, Organisation & HR MarketingHR
5ChiefSenior ManagementMarketing and Sales Operations DirectorDirector
6HRHRDirector, Digital Marketing & Operations - EMEADirector
7PersonnelHRDirector, Digital Marketing & Operations - EMEADirector
8PeopleHRDirector, Digital Marketing & Operations - EMEADirector
9HeadHeadGlobal Operational Marketing ManagerMarketing
10ExecutiveExecutiveGlobal Operational Marketing ManagerMarketing
11OperationsOperationsMarketing Operational Specialist SwedenMarketing
12MarketingMarketingMarketing Operational Specialist SwedenMarketing
13ManagerManagerBid Manager/Sales OperationsOperations
14Account ManagerAccount ManagerBid Manager/Sales OperationsOperations
15FinanceFinanceFMCG Field Operations Manager \ Sales ManagerOperations
16SalesSalesGroup Sales Operations DirectorDirector
17TechnicalTechnicalInfrastructure Manager - Sales & Operations Operations
18EngineerTechnicalManager Sales & Operations PlanningOperations
19AdministratorAdministratorRegional Sales Operations ManagerOperations
20ChefSenior ManagementRemote Sales Operations - SMB ChannelOperations
21ProjectProjectsSales and Operations Director for North AmericaDirector
22DigitalDigitalSales and Operations Director for North AmericaDirector
23EcommerceDigitalSales and Operations LeaderOperations
24AccountingFinanceSales Operations Line ManagerOperations
25
26Current Formula!
27=IF(ISNUMBER(SEARCH($A$2,C2)),$B$2,IF(ISNUMBER(SEARCH($A$3,C2)),$B$3,IF(ISNUMBER(SEARCH($A$4,C2)),$B$4,IF(ISNUMBER(SEARCH($A$5,C2)),$B$5, IF(ISNUMBER(SEARCH($A$6,C2)),$B$6,IF(ISNUMBER(SEARCH($A$7,C2)),$B$7,IF(ISNUMBER(SEARCH($A$8,C2)),$B$8,IF(ISNUMBER(SEARCH($A$9,C2)),$B$9, IF(ISNUMBER(SEARCH($A$10,C2)),$B$10,IF(ISNUMBER(SEARCH($A$11,C2)),$B$11,IF(ISNUMBER(SEARCH($A$12,C2)),$B$12,IF(ISNUMBER(SEARCH($A$13,C2)),$B$13, IF(ISNUMBER(SEARCH($A$14,C2)),$B$14,IF(ISNUMBER(SEARCH($A$15,C2)),$B$15,IF(ISNUMBER(SEARCH($A$16,C2)),$B$16,IF(ISNUMBER(SEARCH($A$17,C2)),$B$17, IF(ISNUMBER(SEARCH($A$18,C2)),$B$18,IF(ISNUMBER(SEARCH($A$19,C2)),$B$19,IF(ISNUMBER(SEARCH($A$20,C2)),$B$20,IF(ISNUMBER(SEARCH($A$21,C2)),$B$21, IF(ISNUMBER(SEARCH($A$22,C2)),$B$22,IF(ISNUMBER(SEARCH($A$23,C2)),$B$23,IF(ISNUMBER(SEARCH($A$24,C2)),$B$24,"No Result")))))))))))))))))))))))
28
29
30
31
32
33
34
35
Nested IFs
Cell Formulas
RangeFormula
D2:D24D2=IF(ISNUMBER(SEARCH($A$2,C2)),$B$2,IF(ISNUMBER(SEARCH($A$3,C2)),$B$3,IF(ISNUMBER(SEARCH($A$4,C2)),$B$4,IF(ISNUMBER(SEARCH($A$5,C2)),$B$5,IF(ISNUMBER(SEARCH($A$6,C2)),$B$6,IF(ISNUMBER(SEARCH($A$7,C2)),$B$7,IF(ISNUMBER(SEARCH($A$8,C2)),$B$8,IF(ISNUMBER(SEARCH($A$9,C2)),$B$9,IF(ISNUMBER(SEARCH($A$10,C2)),$B$10,IF(ISNUMBER(SEARCH($A$11,C2)),$B$11,IF(ISNUMBER(SEARCH($A$12,C2)),$B$12,IF(ISNUMBER(SEARCH($A$13,C2)),$B$13,IF(ISNUMBER(SEARCH($A$14,C2)),$B$14,IF(ISNUMBER(SEARCH($A$15,C2)),$B$15,IF(ISNUMBER(SEARCH($A$16,C2)),$B$16,IF(ISNUMBER(SEARCH($A$17,C2)),$B$17,IF(ISNUMBER(SEARCH($A$18,C2)),$B$18,IF(ISNUMBER(SEARCH($A$19,C2)),$B$19,IF(ISNUMBER(SEARCH($A$20,C2)),$B$20,IF(ISNUMBER(SEARCH($A$21,C2)),$B$21,IF(ISNUMBER(SEARCH($A$22,C2)),$B$22,IF(ISNUMBER(SEARCH($A$23,C2)),$B$23,IF(ISNUMBER(SEARCH($A$24,C2)),$B$24,"No Result")))))))))))))))))))))))
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for updating your profile.
How about
Excel Formula:
=TAKE(FILTER($A$2:$A$24,ISNUMBER(SEARCH($A$2:$A$24,C2))),1)
 
Upvote 0
Hi Fluff,

Many thanks for the suggestion, will give it a go, not heard of the take/filter before!
 
Upvote 0
Hi Fluff,

This appears to work perfectly, thank you. 2 questions if I may? is there a limit on the number of rows for the Take/Filter combination? and is there a way to add in "Not Found" to replace the #CALC if no keyword is found? Really Appreciate your help.
 
Upvote 0
No there is no limit to the range & you can add the not found like
Excel Formula:
=TAKE(FILTER($A$2:$A$1000,ISNUMBER(SEARCH($A$2:$A$1000,C2)),"Not found"),1)
 
Upvote 0
Perfect, Thank you so much, really appreciate you taking the time to help.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hi Fluff,

On testing I noticed, if the keyword can not be found in the C column the formula returns 0 instead of Not Found but if its Blank in the C Column it returns the correct Not Found message. Any ideas?
Test Formula 4 Using Take-Filter.xlsx
ABCD
2OwnerOwner/Founderdfgsfg gss sfdgsdfg sg sdf gsg sdg sdf0
3Co FounderOwner/FounderNot found
Take-Filter Formula
Cell Formulas
RangeFormula
D2:D3D2=TAKE(FILTER($B$2:$B$1000,ISNUMBER(SEARCH($A$2:$A$1000,C2)),"Not found"),1)
 
Upvote 0
Ok, try
Excel Formula:
=TAKE(FILTER($A$2:$A$1000,(ISNUMBER(SEARCH($A$2:$A$1000,C2)))*($A$2:$A$1000<>""),"Not found"),1)
 
Upvote 1
Solution

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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