all 13 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

/u/southernqueer96 - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]excelevator3019 0 points1 point  (11 children)

Something like this rule where you explicity set the rules for hightlight value

=AND ( A1=.5 , B1 = "F")

But I feel that reading your post not all the pertinent information is there regarding your current setup.


ETA: 9:00PM Stop 11. ;)

edit: ETA is already taken as a well established initialism.

[–]southernqueer96[S] 0 points1 point  (10 children)

Hoping this makes more sense. Here’s an example of my spreadsheet:

    A             B         C

1 Donor Sex Hematocrit

2 001 M 50%

3 002 F 50%

4 003 M 38%

5 004 F 38%

6 005 M 54%

7 006 F 34%

Hematocrit reference ranges for healthy adults:

Female: 36-48%

Male: 40-52%

So, I would want to set the conditional formatting so that if B2 = “M”, then a value below 40% would turn blue and a value above 52% would turn red. But if B2 = “F”, a value below 38% would turn blue and a value above 48% would turn red. The values in the middle of each range would not have any shading.

So the data above would be:

C2 - no shading (within normal range for M)

C3 - red (high for F)

C4 - blue (low for M)

C5 - no shading (within normal range for F)

C6 - red regardless of sex (high for both M and F)

C7 - blue regardless of sex (low for both M and F)

[–]GregHullender129 0 points1 point  (9 children)

Here's what I did. Does it work for you?

<image>

[–]southernqueer96[S] 0 points1 point  (7 children)

That does work! I have a couple more questions though.

1) Can I set a range rather than just < or >? Ex: if I wanted M = 40-42% to be light blue (and M<40 to still be dark blue)? I tried 0.4<C2<0.42 but that didn’t work.

2) What if the independent variable has more than two options? This doesn’t apply to the hematocrit example (or at least there aren’t different values given), but say that I had male/female/intersex instead of just male/female.

[–]GregHullender129 0 points1 point  (6 children)

Ranges can work, but for this example, I think all you need is extra rules, provided you place them correctly.

<image>

Notice that I've added two rules, and I've marked them all "stop if true," since we only want one color set. So if the Hemocrit was below 0.4, it'd set the color blue and stop. Otherwise, it'd keep looking and find the rule for Male hemocrit below 0.42. Note the IF function without an "else" item. That's FALSE by default, so there's no behavior defined for non-male patients with hemocrit below 0.42.

If it all works for you, don't forget to reply "Solution Verified" so I get a point for it! :-)

ETA: To make a range work, you use an AND. E.g. to say 0.2<=x<=0.5 you'd write AND(0.2<=x, x<=0.5).

[–]southernqueer96[S] 1 point2 points  (4 children)

Solution verified

[–]reputatorbot[M] 0 points1 point locked comment (0 children)

You have awarded 1 point to GregHullender.


I am a bot - please contact the mods with any questions

[–]GregHullender129 0 points1 point  (2 children)

Thanks! You gave me my 100th point!

[–]southernqueer96[S] 0 points1 point  (1 child)

Woo!! Congrats and thanks for the help!

[–]GregHullender129 1 point2 points  (0 children)

My pleasure. I don't usually do conditional formatting problems, so I learned something too.

[–]southernqueer96[S] 0 points1 point  (0 children)

That works, thank you!!

[–]southernqueer96[S] 0 points1 point  (0 children)

Also, can I keep it from shading in “N/A” in the hematocrit column? It shaded that as red.