Cnvert Formula to macro

deviation

Board Regular
Joined
Dec 17, 2004
Messages
171
Okay I currently have a lengthy formula using multiple IF statements. I even managed to violate the 7 If statement limit.

However it is extremely slow since it must exeist in all 65536 rows ina work sheet

Is there a way to convert this to a macro that will run if data has been added to the sheet?

I tried using ISBLANK, but then realized it still has to search the cells, it takes about 5 minutes to calcualte and entire worksheet which is why i desie a macro to run faster

=IF(ISBLANK(C2),"",IF(OR(C2="ABSNTU",C2="AFTOUP",C2="ANCNSU",C2="ANCNSP",C2="ABPARU",C2="ABPARP"),IF(C2="ABSNTU","A",IF(C2="AFTOUP","A",IF(C2="ANCNSU","N",IF(C2="ANCNSP","N",IF(C2="ABPARU","P","P"))))),IF(OR(C2="ABSAPU",C2="CONS",C2="REMOVE",C2="AFTOP"),IF(C2="ABSAPU","*",IF(C2="CONS","C",IF(C2="REMOVE","R","V"))))))
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
As you approach the limits of the nested IF, it makes sense to consider a Lookup table instead. It appears that this might simplify and speed up your work.
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,764
Members
448,991
Latest member
Hanakoro

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