I'm trying to have a cell becoming highlighted if it satisfies two criteria.
I would like the cells below each Staff column to be purple if its both the same as the version# and contains *.
I've managed to highlight cells containing the * by using "highlight if cells contain" ~* but I can't get it to do both.
I've tried
=AND(L2=$J2,"~*")
=AND($J2,"~*")
=IF(AND(L2=$J2,"~*"))
(Version# is column J, Staff 1 is column L)
Answer by BigBen
If the Staff # contains an asterisk, will it always immediately follow the version #? If so you could just do
=L2=$J2&"*"
Seeing what I think you want, the main issue is the asterisk. When you enter a number in a cell and also enter a non-numerical character the cell automatically becomes formatted as TEXT. It is possible to extract the numerical value with a formula, but handling what you want is much easier if you separate the number from the asterisk. In my included example (You should be able to open it in a new tab on your browser) created narrow columns after each 'staff#' column to accept the asterisk entry.
This done, enter the three conditional formats as shown (in C2 in the example). You then copy the C2 cell into each of the cells under the Staff# columns. That produced the results shown which I think is what you want. Changing entries will produce the proper formatting results for that cell.
Related
I have two columns to compare. All cell values come from the ROUNDUP function. =ROUNDUP(C6/D12,0) etc.
I want the larger, or equal, of the two in each row to be green and the smaller red. Using the formula, it does not work as expected. If I do the same with numbers typed, not the formula, it works. It appears the formatting applies to the formula and not the value.
That is the first half of the problem. I also want to autofill/paint the conditional formatting to numerous cells, but it always compares to the top left cell, rather than the two cells on the same row.
If I use the color scales formatting it works, but I do not want the scales, just red/green.
It seems hard to believe that what I want to do is not possible. Can someone please help me with this. Thanks in advance.
In conditional formatting, under 'use a formula to determine which cells to format', you need to enter
=A2=MAX($A2,$B2)
to highlight the larger cell and (as a separate rule)
=A2=MIN($A2,$B2)
to highlight the smaller cell.
Note that in the case where both cells have the same value, they will both be either coloured red or green depending on the precedence of the rules. If the 'green' rule comes first,
it will look like this:
Conditional formatting is almost its own little science within Excel. It may be more useful to find youtube tutorials on the topic than depend on a text explanation here. But the central theme is this.
You will use location locking (the dollar sign or F4) in front of the letters so that any cell to which the format is applied knows you specifically mean columns E and F, for instance.
Example: Assume your first row goes from A5 to M5, and the condition values are in E5 and F5.
I find it easiest to format one row with the rules I want, test them, and then use the format painter or copy -> paste format along with careful use of $ locking.
Drag over and select the entire row of cells A5:M5
Conditional Formatting -> New Rule -> Use a formula to determine which cells to format
In the formula field enter =$E5>$F5. Excel gets weird and often inserts double quotes. If you save the rule and go back in, it may say ="$E5>$F5" and if so delete the double quotes.
Click Format and create the cell format you want.
With A5:M5 still selected, add another rule and format for ="$E5<$F5"
The $ sign works the same way as it does in a formula. All of the columns get their format based on columns E and F, but all of the rows base their formula on the E and F values in that same row.
I have searched far and wide but cannot seem to find a question that answers this.
I am trying to highlight/color an entire row in Microsoft Excel for Mac (16.33) based on two different values in two different columns.
This is my current forumla:
=AND(SEARCH("no",INDIRECT("C"&ROW())),SEARCH("yes",INDIRECT("D"&ROW())))
From my understanding, it is searching first in column C for "No", then proceeding to search column D for "yes". Enclosing this in AND() must ensure that both cases are true. If they are not, it returns false and does not apply the formatting.
This formula should return something like this, which works perfectly with the above example in Google Sheets:
Column D contains a yes, but Column C also contains a no, rendering the entire row yellow.
Since conditional formatting works top to bottom, it moves on to the next rule which is:
=SEARCH("yes",INDIRECT("D"&ROW()))
Hence, two "yes" return full green across the row.
I cannot get this to work in Excel with the same exact formulas. I have ensured the correct cell range has been selected for conditional formatting.
Why is such a complex formula needed? The following must work in Excel:
=($C1="N")*($D1="Y") - for yellow
=($C1="Y")*($D1="Y") - for green
Don't know about GoogleSheets
I'm trying to make a formula that will color code three cells that are directly above/below each other. The color coding depends on the sum of three other cells that are directly above/below each other, and directly across from the cells to be colored.
This part is easy. The rule is:
Forumula: =SUM(H5:H7)>30
And it applies to:
$E$5:$E$7
However, the issue is that when I copy the cells that are being colored (E's) to three more cells below them for the next batch, the relative formula does not work as expected. It applies the formula on H6:H8 (+1) instead of H8:H10 (+3).
Is there a way to get the relativeformula to work as expected? I hope this was clear enough. I know it's hard to visual a spreadsheet, but ultimately I need the relative forumla to add +3 instead of +1 when it is copied.
Problem:
If I correctly understand, what you are trying to achieve is to have the range E5:E7 formatted strictly based upon H5:H7, then the next three-cell range - E8:E10 - based upon H8:H10 and so on. You can do this by implementing the below solution:
Solution:
Step 1: Setup Columns as Below
Step 2: Implement Conditional Formatting as Below
Explanation:
I have recreated your issue and I see your problem; it was not that obvious until I played around with changing values of different cells in Column H.
Apparently, this has to do with how Excel interprets your instructions (formula) supplied under conditional formatting. To understand this let's first focus on the behavior of cells E5, E6 and E7 as a function of values in Column H.
With the formula =SUM(H5:H7)>30 did you notice that:
E5 format depends upon =SUM(H5:H7),
E6 format depends upon =SUM(H6:H8), and
E7 format depends upon =SUM(H7:H9) and
when you copy the range E5:E7 three cells down into E8:E10, the expected behavior is:
E8 format depends upon =SUM(H8:H10),
E9 format depends upon =SUM(H9:H11), and
E10 format depends upon =SUM(H10:H12)
And this is exactly how the range E8:E10 will behave once the above solution is applied.
A partial answer to your question has to do with your relative formula - =SUM(H5:H7) - under conditional formatting. Using this formula causes $E$5 to use =SUM(H5:H7) to determine its formatting, $E$6 to use =SUM(H6:H8) to determine its formatting, and so on. This ultimately leads to issues with the conditional formatting even before you begin copying the cells down.
EDIT: (piggy-backing off #Bharat Anand's answer)
#Bharat Anand's answer appears to be the best way to accomplish this question.
#Thisisstackoverflow requested clarification (under the accepted answer) and I'm hoping my screenshot below will help.
I set my worksheet up in what I believe is the exact same manner as #Bharat Anand, and it seems that the column letters may have been off. Setting mine up like this made it work correctly.
EDIT: (clarification for future visitors)
I really liked #Bharat Anand's solution, so I wanted to explain how it works (using the images/formulas in the solution as reference):
The calculation in Column I is setup to return a number that will only appear three times, in succession, in Column I; in this way it kind of behaves like a unique identifier, allowing other formulas to reference these values for calculation purposes.
Three times is key for the original poster because they were looking for a range of three cells to be formatted based on a sum of three cells. For example, the formula in Column I can be modified to
=ROUNDDOWN((ROW()-b)/a,0)
where:
a is your desired number of cells to format/sum, and
b is equal to a - 1.
Using the formula in J5 as an example, this SUMIF formula uses I3:I7, which includes two (or b, as setup in my explanation above) rows above and two (b) rows below to decide if I5 equals any of the values found in I3:I7. It's important to include the two rows above and two rows below so that the range overlaps the same three cells to meet the requested requirements.
When I5 finds a match, the formula looks to Column H to sum those rows in H3:H7 where I3:I7 equals I5. In this example, J5, J6, and J7 will each equal 32.
Using the simple conditional formatting formula that was setup, we know that cells in Column E should be highlighted when the corresponding row in Column H is greater than 30. According to the original question, this should be done in ranges that are three (a) rows tall. We already handled for that, so all that was left was to make sure the conditional formatting spanned the data area in Column E.
I'm hoping I don't confuse and/offend anyone with this explanation, but it's how I understand it. I like the proposed solution and explaining it to myself again helps me solidify how it works.
I have a spreadsheet (Google spreadsheet) where I register information about employee´s education. In the bottom of each column (every employee is represented by a column) I want the cell to display "Yes" if there is text in two other specified cells. (Not if there is text in only one of them, or none of them.)
I have tried all kinds of combinations using AND and IF and NOTBLANK, but I probably have the wrong syntax, or use the functions wrong.
So what I need help to understand is if there is text in cell B3 and in cell B34, how can I create a formula that displays the text "Yes" in cell B38?
Please try:
=if(and(not(isblank(B3));not(isblank(B34)));"Yes";"No")
This may cover a wider range of possibilities than you require but it is usually easeir to trim back than to expand. For example, If either B3 or B34 is empty, this formula returns No, rather than nothing at all (but the No is not obligatory) and the "text" in B3 and B34 can be either alpha or numeric, or a mixture.
Please try this, it works:
=IF(OR(ISBLANK(B3),ISBLANK(B34),NOT(ISTEXT(B3)),NOT(ISTEXT(B34))),"No","Yes")
Logic:
If any of Cell B3 or B34 is blank or contains Non-Text value is returns "No". It just returns "Yes" only if both the cells have a "Text" value.
More short and powerful Formula as per your requirement is as follows:
=IF(AND(ISTEXT(B3),ISTEXT(B34)),"Yes","No")
lets say I have a xls sheet with just one column which has the following content:
1
2
3
3
4
5
5
6
You see there are some cells with equal content.
Now I want Excel to format (e.g. background) all cells which are there twice.
I would say that conditional formatting is the right way but there I always have to enter a certain cell.
Is there any possibility to do this?
Best,
Elias
I do this routinely. Start at the second cell and select the rest. Choose Conditional Formatting, as you thought, select VALUE IS EQUAL TO, and click the cell above (let's call it A1). Here's the trick: it will enter this as an absolute reference - $A$1 - but you need to strip out the dollar signs, so it is relative. Now (of course) assign a background color, or whatever style you want, and the first cell in any sequence of identical values will have normal formatting, but subsequent cells will have the style you choose.
This isn't exactly what you've asked for - the first 3, for instance, will still have normal formatting - and I'm not sure I know a way to get all the duplicated cells, including the first, styled differently. But it's a start...
Select A1:A8 and enter this conditional format - Formula Is
=COUNTIF($A:$A,A1)>1
and set a format. It will format anything in column that appears more than 1 time.