Need help with code!

walky82

New Member
Joined
May 18, 2008
Messages
40
Hey can some one please help me....

I am not to sure why this code is not working....

=IF(AND((D17=6),((YEAR(NOW())-YEAR(K5))<25),(N13>=3),(F11+H11+J11+L11+N11)=0),5,IF(AND((D17=6),((YEAR(NOW())-YEAR(K5))<25),(N13>=5),(F11+H11+J11+L11+N11)=0),3,D17))

All i want this to do is.... either put a 5 or a 3 and if not just put whatever is in D17, but it wont work...

Thanks heaps in advance!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

northwolves

Well-known Member
Joined
Jun 21, 2006
Messages
1,128
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
  6. 2007
  7. 2003 or older
Platform
  1. Windows
Try:
=(D17=6)*(YEAR(NOW()-YEAR(K5))<25)*(F11+H11+J11+L11+N11=0)*IF(N13>=5,3,IF(N13>=3,5,D17))

Regards
Northwolves
 
Upvote 0

northwolves

Well-known Member
Joined
Jun 21, 2006
Messages
1,128
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
  6. 2007
  7. 2003 or older
Platform
  1. Windows
All i want this to do is.... either put a 5 or a 3 and if not just put whatever is in D17, but it wont work...
-------------------
A bit Ambiguous ,maybe an example can help you to Explanate it.

Regards
Northwolves
 
Upvote 0

walky82

New Member
Joined
May 18, 2008
Messages
40
Sorry mate about the ambiguity.. This a two scenarios that can be either true or false...<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
=IF(AND((D17=6),((YEAR(NOW())-YEAR(K5))<25),(N13>=3),(F11+H11+J11+L11+N11)=0),5, - If this statement is true a 5 will be entered into that cell. <o:p></o:p>
<o:p></o:p>
<o:p></o:p>
IF(AND((D17=6),((YEAR(NOW())-YEAR(K5))<25),(N13>=5),(F11+H11+J11+L11+N11)=0),3, - If this statement in true it will put a 3 in the cell<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
D17)) - If not whatever is in cell d17 will appear in the cell<o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,190,603
Messages
5,981,890
Members
439,743
Latest member
KatieO

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
Top