Solved

SharePoint 2010 Conditional Statements in Calculated Column

Posted on 2012-03-21
5
1,678 Views
Last Modified: 2012-08-14
I have a SharePoint list that has a column called "Rev Due" which is a set due date. I have a calculated column in this list called "Overdue". In the formula for this column I have this code:

=IF(Today>[Rev Due],"Yes","No")

Open in new window


It works great. It displays "Yes" if the date is overdue. I need to add one more condition. I have another column called "Status". I need it to only display "Yes" if the Status is also "Not Started".  I cannot figure out how to make SharePoint accept the second condition.

I tried to modify this example found online as a base but I can't get it to work:

=IF(AND([Column1]>[Column2], [Column1]<[Column3]), "OK", "Not OK")

Open in new window


End result needed: The word "yes" only displays if the date is overdue and the status is "not started".

Thanks!
0
Comment
Question by:jj1103
  • 3
  • 2
5 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37746621
How about:

=IF(Today<=[Rev Due],No, IF([Status] ="Not Started","Yes","No"))
0
 

Author Comment

by:jj1103
ID: 37746729
This produces an error in syntax.
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 37746741
I left off a couple of quotes.  Try:

=IF(Today<=[Rev Due],"No", IF([Status] ="Not Started","Yes","No"))

I'm an Access guy, so we use the IIF( ) function.  The IF( ) syntax looks more like Excel.  Sure wish Microsoft would standardize these functions across applications.
0
 

Author Comment

by:jj1103
ID: 37746748
This code makes everything display "No"....what should I change?

=IF(AND(Today>[Rev Due],[Status]="Not Started"),"Yes","No")

Open in new window

0
 

Author Comment

by:jj1103
ID: 37746766
Fixed it!  I had to delete the "Today" column I made to trick SharePoint into using the "Today" code.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question