
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Equal Sign not working in If Statement used to conditionally Color Code a Cell in a Table
I have a table where I want to color code the cells with the value of 0 in it (and only the cells that equal 0).
In the Background Color Expression of a table, I have the following expression: “If(([Suspense Date]-[Assigned Date] = 0), red())”.
No cells are colored – which is not what I expected.
However if I change the expression to “If(([Suspense Date]-[Assigned Date] > 0), red())” I get all the cells colored red with a value greater than 0 (as expected).
I must not be checking for equality correctly because if I try “If(([Suspense Date]-[Assigned Date] = 6), red())” it still doesn’t work.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try like below
If(Floor([Suspense Date])-Floor([Assigned Date]) = 0, red())
Please close the thread by marking correct answer & give likes if you like the post.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try like below
If(Floor([Suspense Date])-Floor([Assigned Date]) = 0, red())
Please close the thread by marking correct answer & give likes if you like the post.
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
your background color expression should be relevant to the expression used in Data tab.
let us know more details about your graph. (Dimensions & expressions Used)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mayil,
Thanks so much! Adding Floor worked. Can you help me understand why it worked? Why do I use Floor here but not when it's a greater than or less than? (I'm a total newbie and trying to learn).
Thanks again!
Meg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI
Might be, ur date field has timestamp.
so its always has some decimal values if you subtract two timestamp values.
Please close the thread by marking correct answer & give likes if you like the post.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes! I am subtracting two date fields in the format of: "7/27/2021 10:34:00 AM"
So you have to use Floor with timestamped values?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Floor function helps to ignore the time values & compare the date alone.
Hope it helps
Please close the thread by marking correct answer & give likes if you like the post.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mayil,
Yes, very helpful! Thanks so much.
Meg
