Solved

Help with calculated field in sharepoint

Posted on 2011-03-16
6
456 Views
Last Modified: 2012-05-11
I have a sharepoint list I am using to help rate things on a dashboard view.  I have 20 fields that get a rating of either Blue, Green, Yellow, Red or Grey (Grey is not applicable).  These fields are DB_RTG001 - DB_RTG020.
 
I want to have a field called RTG that is a calculate field which is the average of all. And then about field called COLOR which is the overall rating color.

I was thing that the Colors would have values:
Blue - 5
Green - 4
Yellow - 3
Red - 1
Grey - 0?

How would I set up the calculated field and then the color field?
0
Comment
Question by:Matt Pinkston
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35149968
You can add the calculated field to be
([DB_RTG001]+[DB_RTG002]+......+[DB_RTG020] )/20

Make sure you use 0 decimal points as your number value.

Best of luck
0
 

Author Comment

by:Matt Pinkston
ID: 35150056
but the DB_RTG### fields equal either (Blue, Green, Yellow, Red or Grey)
0
 
LVL 14

Expert Comment

by:GeorgeGergues
ID: 35150364
You might want to investigate some Javascript in content query webpart

first you might want to contact all the colors in a single string . then parse and count the encounter of "Blue" , Green ...

Also you can get the values in colors.


This article should give you some ideas

http://www.orbitone.com/en/blog/archive/2010/10/25/calendar-colour-coding-in-sharepoint.aspx

I am sorry I cannot go beyond that point.

Best of luck
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Matt Pinkston
ID: 35153059
looking for a way using IF in the calc field to do the addition like if DB_rt1001 = "blue" + 4, if DB_rt001 = "green" +3 so on...  
0
 

Author Comment

by:Matt Pinkston
ID: 35181075
still looking for a solution, I am not proficient with if statements in a calculated SP field but pretty sure this can be done.
0
 
LVL 6

Accepted Solution

by:
Rafael I earned 500 total points
ID: 35225654
try this:

put the numbers in front of the choices, as if you're numbering them for the user" "0 - Grey; 1 - Red; 2 - Yellow; etc"

then in the column that you're using to average, use this to find each value: VALUE(LEFT(Color,1))

Left(ColumnName,1) will return the 1st character of the field and Value should return the numerical value of that character

If not, mix and match from these sites and try thinking in Excel:
http://office.microsoft.com/en-us/windows-sharepoint-services-help/CH001171117.aspx
http://office.microsoft.com/en-us/windows-sharepoint-services-help/examples-of-common-formulas-HA001160947.aspx?pid=CH011711541033
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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