2

Why does SharePoint not understand to change the image when I use If statements? Specifically when I use it on a calculated culumn.

Building a status (project/risk) page and I use Probabiliy and Impact (1-3) to score the status/risk. No problem, then I use a calculated column to show images based on the value of the two combined(1-9 (green, Yellow, red).

If I point the calculated column to one of the values (Probability or Impact) I can get the image to change based on the value, but when I aim the column at the combined value it seems to not understand the value, all I get is a green light?!

The syntax seems to be right since i can get the result on the individual values, but not the combined...

Here is the formula i use in the caolculated culumn, by the way.

="<center>"&
    IF([Risk_value]<="4","<img src='/sites/111607/CDC_STHLM/SiteAssets/Status_pic/Green.gif' border='0'/>",
    IF([Risk_value]="6","<img src='/sites/111607/CDC_STHLM/SiteAssets/Status_pic/Orange.gif' border='0'/>", 
    IF([Risk_value]>"6","<img src='/sites/111607/CDC_STHLM/SiteAssets/Status_pic/Red.gif' border='0'/>")))
    &"</center>"
2
  • Please also post the formula for the individual columns that are working.
    – Erin L
    Commented Nov 16, 2016 at 13:33
  • Same code, just different goal column, so rather than "IF([Risk_value]" just IF([Impact], that is one of the two columns that "Risk_value" is built on. I realised that the problem was with me using the wrong format, text instead of numbers ("4" rather than just a plain 4)
    – Mydeza
    Commented Nov 16, 2016 at 15:30

2 Answers 2

0

Can you please provide the formula you've added in the calculated column formula field , since there are certain format need to be maintained while combining multiple columns in the calculated column formula field.

Please refer the below link for more info on this topic:

https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx

1
  • Here it is, it seems to be cut in the original: ="<center>"& IF([Risk_value]<="4","<img src='/sites/111607/CDC_STHLM/SiteAssets/Status_pic/Green.gif' border='0'/>", IF([Risk_value]="6","<img src='/sites/111607/CDC_STHLM/SiteAssets/Status_pic/Orange.gif' border='0'/>", IF([Risk_value]>"6","<img src='/sites/111607/CDC_STHLM/SiteAssets/Status_pic/Red.gif' border='0'/>"))) &"</center>"
    – Mydeza
    Commented Nov 16, 2016 at 13:37
-1

Numeric value needs to be used because the Risk_value field is a number, e.g. =4, NOT ="4"

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.