Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2018, 01:45 AM
Aliwoods Aliwoods is offline Help with nested If statements Windows XP Help with nested If statements Office 2016
Novice
Help with nested If statements
 
Join Date: Jul 2018
Posts: 4
Aliwoods is on a distinguished road
Default Help with nested If statements

Can someone please tell me what is wrong with this nested If statement?



=IF(TODAY()-A70>90,2,3),IF(F70<>"","1","")

What I am trying to do is show a result of either "2" or "3" depending if date in cell A70 is less than/greater than 90 days from todays date
And
if cell F70 is not left blank to show a result of "1"
Reply With Quote
  #2  
Old 07-16-2018, 01:49 AM
Debaser's Avatar
Debaser Debaser is offline Help with nested If statements Windows 7 64bit Help with nested If statements Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

Does the test for F70 take precedence over the date test? Assuming so, your formula would be:

=IF(F70<>"",1,IF(TODAY()-A70>90,2,3))
Reply With Quote
  #3  
Old 07-16-2018, 02:32 AM
Aliwoods Aliwoods is offline Help with nested If statements Windows XP Help with nested If statements Office 2016
Novice
Help with nested If statements
 
Join Date: Jul 2018
Posts: 4
Aliwoods is on a distinguished road
Default

I think I got this wrong as I need the result as “1” if cell F70 is NOT blank and includes a date or text. The result you gave me shows cell result “1” I’d cell F70 is blank - how do I change this part?
Reply With Quote
  #4  
Old 07-16-2018, 03:09 AM
ArviLaanemets ArviLaanemets is offline Help with nested If statements Windows 8 Help with nested If statements Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Quote:
I think I got this wrong as I need the result as “1” if cell F70 is NOT blank and includes a date or text. The result you gave me shows cell result “1” I’d cell F70 is blank - how do I change this part?
You got something wrong here!

Debaser's formula
Code:
=IF(F70<>"",1,IF(TODAY()-A70>90,2,3))
1. when cell F70 is not empty, returns always 1 (and ignores any value in A70);
2. when cell F70 is empty, returns the value of expression
Code:
IF(TODAY()-A70>90,2,3)
i.e. either 2, 3, or some error code. Never 1 is returned.

Check cell F70. e.g. enter into some free cell the formula
Code:
=F70
Reply With Quote
  #5  
Old 07-16-2018, 03:16 AM
ArviLaanemets ArviLaanemets is offline Help with nested If statements Windows 8 Help with nested If statements Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

I can't somehow edit my post (Edit window opens, but the post is not there).

The formula to check cell F70 will be better
Code:
=LEN(F70)
When 0 is returned, the cell is empty, otherwise not.
Reply With Quote
  #6  
Old 07-16-2018, 06:10 AM
Aliwoods Aliwoods is offline Help with nested If statements Windows XP Help with nested If statements Office 2016
Novice
Help with nested If statements
 
Join Date: Jul 2018
Posts: 4
Aliwoods is on a distinguished road
Default

I am none the wiser.
So column A has a manually entered date. Column D will identify Priority. If date in column A is greater than 90 days old from today’s date then column D should state “2”. If the date in column A is less than 90 days old then column D should state “3”. Column F shows a deadline and what I want to do is, if column F shows a deadline date, then column D must show “1” as this will be high priority. Any help what formula I should use?
Reply With Quote
  #7  
Old 07-16-2018, 06:12 AM
Debaser's Avatar
Debaser Debaser is offline Help with nested If statements Windows 7 64bit Help with nested If statements Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

The formula I gave you works like this:

If F70 has anything in it, it returns 1.
Otherwise, if A70 is more than 90 days old, it returns 2, but if A70 is more recent, it returns 3.
Reply With Quote
  #8  
Old 07-16-2018, 06:18 AM
Aliwoods Aliwoods is offline Help with nested If statements Windows XP Help with nested If statements Office 2016
Novice
Help with nested If statements
 
Join Date: Jul 2018
Posts: 4
Aliwoods is on a distinguished road
Default

Thank you it worked. I missed a comma. Thank you
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with nested If statements Conditional checkbox mailmerge: coding "or" statements within IF statements mtracy16 Mail Merge 3 05-22-2018 02:03 PM
Help with nested If statements Nested If Statements in Formula Field to Produce the Diffrnc in Years Between Today's & Entered Date mshu31 Word 1 02-09-2017 02:04 PM
Help with nested If statements Error in If statements Warren99 Excel 8 05-29-2016 01:59 PM
Help with nested If statements Help with if then statements brent chadwick Word VBA 35 07-25-2015 02:41 PM
Help with nested If statements Using IF statements stuwoolf Excel 2 01-10-2015 01:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft