cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Conditional Formatting with <> and colors

Hi,

I am doing a project where I what to know if something is over a time limit to color it a certain color, or if it's under a certain time limit it colors the box a different color. Here is what I have so far:

 

If(
Value(Lastupdate.Text)> 1,
Hours, Color.Chartreuse=Green,
Value(Lastupdate.Text)< 2,
Hours, Color.Red=Red,
Color.Yellow=Yellow
 
Any ideas on how to fix this?
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Conditional Formatting with <> and colors

Hey @Anonymous,

 

Could we get some more details on what scope you want the colours to fall in - I am going to assume all values up until 1 are Green, 1 to 2 are orange and anything greater than 2 is red - would that be correct?

 

I am going to try to make the code more visually-friendly so that you don't have to dissect it several months later when reviewing it:

 

If(
   //Condition 1
   Value(Lastupdate.Text)>=0 && Value(Lastupdate.Text)< 1,
   Chartreuse,   

   //Condition 2
   Value(Lastupdate.Text)>=1 && Value(Lastupdate.Text)<=2,
   Yellow,
   
   //Else condition (any value larger than 2)
   Red
)

 

Can we assume that your Lastupdate is a label and that it shows numbers values such as 1.5 ?

 

Let me know if this helps or if you need any further information with implementing this,

 

Cheers,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

2 REPLIES 2
EricLott
Level 10

Re: Conditional Formatting with <> and colors

In the textbox you want to change the color of, in the Color property, use this:

If(And(Value(Lastupdate.Text)>=1,Value(Lastupdate.Text)<2),Green,If(Value(Lastupdate.Text)<=2,Red,Yellow))

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up. 

Super User
Super User

Re: Conditional Formatting with <> and colors

Hey @Anonymous,

 

Could we get some more details on what scope you want the colours to fall in - I am going to assume all values up until 1 are Green, 1 to 2 are orange and anything greater than 2 is red - would that be correct?

 

I am going to try to make the code more visually-friendly so that you don't have to dissect it several months later when reviewing it:

 

If(
   //Condition 1
   Value(Lastupdate.Text)>=0 && Value(Lastupdate.Text)< 1,
   Chartreuse,   

   //Condition 2
   Value(Lastupdate.Text)>=1 && Value(Lastupdate.Text)<=2,
   Yellow,
   
   //Else condition (any value larger than 2)
   Red
)

 

Can we assume that your Lastupdate is a label and that it shows numbers values such as 1.5 ?

 

Let me know if this helps or if you need any further information with implementing this,

 

Cheers,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,055)