Nested IF Statement taking too long

Toza

New Member
Joined
Mar 16, 2011
Messages
2
I'm currently using the below if statement to find cells with column AC that contain MISY2L, CNFM2L or SBOS3Q. The formula itself works fine but when it autofills (about 10,000 lines) excel is taking about 10 mins to caluate the values.

Range("AI2").Formula = "=IF(ISNUMBER(SEARCH(""*MISY2L*"",AC2)),""ETC"",IF(ISNUMBER(SEARCH(""*CNFM2L*"",AC2)),""ETC"",IF(ISNUMBER(SEARCH(""*SBOS3Q*"",AC2)),""ETC"","""")))"
Range("AG2:AI2").AutoFill Destination:=Range("AG2:AI" & Cells(Rows.Count, "AC").End(xlUp).Row)

Is there a more efficient way to achieve the same outcome?

Thanks
Torin
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the board..

Here's one way.
This is how it appears in the cell, I'll leave it to you to translate into your Code.

Code:
=IF(ISNUMBER(LOOKUP(2^15,SEARCH({"MISY2L";"CNFM2L";"SBOS3Q"},AC2))),"ETC","")
 
Upvote 0

Forum statistics

Threads
1,224,567
Messages
6,179,571
Members
452,927
Latest member
whitfieldcraig

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