1,804 articles and 14,829 comments as of Wednesday, May 11th, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint content all in one place!

This site is a historical archive and is no longer being updated. Please update your favorites, bookmarks and RSS feeds.

NothingButSharePoint.com
Tuesday, May 5, 2009

Taming the Elusive “Calculated Column” – Logic – Part 7

The truth, the whole truth “AND/OR” nothing but the truth

The “AND” function is similar to the “OR” function in that it will look at up to 30 different values for comparison, but it’s difference is that in order for the final “Result” to be “TRUE”, each and every condition must be true in the entire check or the end result will always be “FALSE”.

It’s important to understand this difference because it will influence the choice in their usage (deciding between OR/AND) and how your logic will be built.

Before we look at our “Truth Table” to see how the different combinations of values will produce results when using the “AND” function, we need to reevaluate the conditions we’re checking. If we were to look at the “Truth Table” now, before modifying our conditions, the only combination of values that would ever cause an employee to receive a paycheck would be if they had actually done all three, so let’s modify things a little before examining the table.

We know that in order for an employee to be issued a paycheck, they must first be in the system as an actual “Employee”, so we’ll use this as our first condition to check.

“Employee”

Next, we know (based on the last article with the usage of the “OR” function) that in order for the employee to be issued a paycheck, they must have some sort of record of time to track how many hours they need to be paid for.  This is in the form of three possible records:

“Regular Hours”
“Vacation”
“Sick Leave”

Since we’re not quite at the point where we can “merge” the “OR” function and the “AND” function (coming shortly), let’s just look at three different versions of the “Truth Table” that will process each type of hours tracked:

Calculated Column Part 7

Calculated Column Part 7

Calculated Column Part 7

Notice in all three that the only time the end result is “TRUE” is when both conditions are true as well:

Person is “Employee” and has worked “Regular Hours” = “TRUE” (Issue paycheck)
Person is “Employee” and has taken “Vacation” = “TRUE” (Issue paycheck)
Person is “Employee” and has submitted “Sick Leave” = “TRUE” (Issue paycheck)

In all other cases in each table, at least one of the conditions is “FALSE”, so the end result is also “FALSE”.

Next, we’ll look at combining the “AND” function with the “OR” function in order to test for each of the three possible type of hourly tracking in the same table.

- Dessie

Dessie LunsfordDessie Lunsford
Points-of-Sharing

View all entries in this series: Dessie Lunsford-Logic Formulas»
Entries in this series:
  1. Taming the Elusive "Calculated Column"
  2. EndUserSharePoint.com: Taming the Elusive "Calculated Column" - Customizing a Task List
  3. EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Task List (Part II)
  4. EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Task List (Part III)
  5. EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Task List (Part IV)
  6. EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Text and Data
  7. EndUserSharePoint.com: Taming the Elusive "Calculated Column" - Customizing a Contacts List (Part I)
  8. EndUserSharePoint.com: Taming the Elusive "Calculated Column" - Customizing a Contacts List (Part II-I)
  9. EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Contacts List (Part II-II)
  10. EndUserSharePoint.com: Taming the Elusive “Calculated Column” - Customizing a Contacts List (Part II-III)
  11. EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part III)
  12. EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part IV)
  13. EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part V)
  14. EndUserSharePoint.com: Taming the Elusive “Calculated Column” – Text and Data (Part VI)
  15. Taming the Elusive “Calculated Column” – Lookup and Reference
  16. Taming the Elusive “Calculated Column” - Logic
  17. Taming the Elusive “Calculated Column” - Logic - Part 1
  18. Taming the Elusive “Calculated Column” - Logic - Part 2
  19. Taming the Elusive “Calculated Column” - Logic - Part 3
  20. Taming the Elusive “Calculated Column” - Logic - Part 4
  21. Taming the Elusive “Calculated Column” - Logic - Part 5
  22. Taming the Elusive “Calculated Column” - Logic - Part 7
  23. Taming the Elusive “Calculated Column” - Logic - Part 6
  24. Taming the Elusive “Calculated Column” - Logic - Part 8
  25. Taming the Elusive “Calculated Column” - Logic - Part 9
  26. Taming the Elusive “Calculated Column” - Logic - Part 10
  27. Taming the Elusive “Calculated Column” - Date and Time - Part 1
  28. Taming the Elusive “Calculated Column” - Date and Time - Part 2
  29. Taming the Elusive “Calculated Column” - Date and Time - Part 3
  30. Taming the Elusive “Calculated Column” - Date and Time - Part 4
  31. Taming the Elusive “Calculated Column” - Referencing Multiple Lines of Text Column
  32. Taming the Elusive “Calculated Column” – Date and Time – Part 5
  33. Taming the Elusive “Calculated Column” – Date and Time – Part 6
  34. Taming the Elusive “Calculated Column” – Date and Time – Part 7
  35. Taming the Elusive "Calculated Column" - Referencing a Multiple Lines of Text Column With Append Text: Part 1
  36. Taming the Elusive "Calculated Column" - Referencing a Multiple Lines of Text Column With Append Text: Part 2
  37. Taming the Elusive "Calculated Column" - Referencing a Multiple Lines of Text Column With Append Text: Part 3
 

Please Join the Discussion

One Response to “Taming the Elusive “Calculated Column” – Logic – Part 7”

Trackbacks

Check out what others are saying about this post...
  1. [...] Taming the Elusive “Calculated Column” – Logic – Part 7 [...]




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!