Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated Column Formula (Nesting Help)

Status
Not open for further replies.
May 10, 2006
22
US
Running MOSS 2007 and have created a calculated column. I could use a hand coming up with a proper formula for it. There are 3 states the calculation needs to display (New, Refresh, <blank>). Here is what the formula needs to accomplish:
[ul]
[li]IF ORD >= TODAY, "New" [/li]
[li]IF ORD < TODAY & NRD >= TODAY, "Refresh" [/li]
[li]Else, ""[/li]
[/ul]

I know how to do a formula for one or the other IF/THEN/ELSE statements (see below), but don't know how to combine them.
Code:
=IF(ORD>=TODAY),"New","" 
=IF(AND(ORD<TODAY,[NRD]>=TODAY),"Refresh","")

I've tried putting these together in various ways but so far no joy. This is what I've attempted to use but obviously don't have the syntax correct...
Code:
=IF(([ORD]>=[TODAY],"New"),(AND([ORD]<[TODAY],[NRD]>=[TODAY]),"Refresh"))

How should I write this better?

The second question I have is where can I find a good source on educating myself on this? So far I've found very good information on the functions supported by SharePoint but they only explain what each of the Functions, Operators & Constants are. Nesting them is where I stumble. Assistance on this would be very appreciated.
 
Try something like this -
=IF(([ORD]>=[TODAY],"New"),IF(AND([ORD]<[TODAY],[NRD]>=[TODAY]),"Refresh"),"")

carl
MCSD, MCTS:MOSS
 
Thank you for the help. Your idea was excellent. It didn't work that way but changing where the parenthesis were located did the trick.

=IF([ORD]>=[TODAY],"New",(IF(AND([ORD]<[TODAY],[NRD]>=[TODAY]),"Refresh","")))

Oh, and in case anyone else is looking for information on this, here's a great resource for logical functions for use in SharePoint calculated columns:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top