Code won't run in XL2003

BradleyS

Active Member
Joined
Oct 28, 2006
Messages
333
Office Version
  1. 2010
Platform
  1. Windows
Hi
If possible could somebody tell me why this section of formula code won't work in XL2003?
It runs fine in XL2010, but I need it to work in XL2003 as well.


'ActiveCell.FormulaR1C1 = _
'"=IF(DATE(1938,9,1)>=RC2,""FLU2"",IF(DATE(1948,9,1)>=RC2,""FLU1"",IF(DATE(1948,9,1)<=RC2,IF(RC[8]=""Carer"",""ZFCARE"",IF(RC[8]=""Chronic Heart Disease"",""ZFCHD"",IF(RC[8]=""Chronic Liver Disease"",""ZFCLD"",IF(RC[8]=""Chronic Neurological Disease"",""ZFCNS"",IF(RC[8]=""Chronic Renal Disease"",""ZFCRD"",IF(RC[8]=""Chronic Respiratory Disease"",""ZFCRES"",IF(RC[8]=""Diabetes"",""ZFDM"",IF(RC[8]=""Long-stay residential"",""ZFHOME"",IF(RC[8]=""Immunosuppression"",""ZFIMM"",IF(RC[8]=""Pregnant"",""ZFPREG"",IF(RC[8]=""Stroke / TIA"",""ZFSTIA"",IF(AND(RC[-2]<=DATE(2010,9,1),RC[-2]>=DATE(2009,9,1)),""ZLF3"",IF(AND(RC[-2]<=DATE(2011,9,1),RC[-2]>DATE(2010,9,1)),""ZFL2"",IF(RC[8]="""",""Unidentified"",)))))))))))))),""N/A"")))"
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Ok, the reason it doesn't work in 2003 is that 2003 has a 7 Nested IF limit !!
Without seeing some data, I'm guessing you'll need to create something like a VLOOKUP list to find the data you need !

AND
Please use code tags when posting, it makes the examples far easier to read and debug.
See the last line of my tag for this
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,789
Members
449,126
Latest member
Greeshma Ravi

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