Excel Conditional Formatting Formula - excel

I am trying to make a column do this: so lets say
If the score of 4 is made from a 2 x 2 then it is green.
If the score of 4 is made from a 4 x 1 or a 1 x 4 then it is yellow.
I am done the formula for the green and the yellow but it only happens once. So if I change a 2 x 2 to 4 x 1. It will stay green. Not change to yellow.
Formula for Green (2x2):
=IF(G31=4,IF(D15=2,IF(F15=2,0,1),1),0)
Formula for Yellow (4x1, 1x4):
=IF(G31=4,IF(D15=4,IF(F15=1,0,1),1),0)
Please help me work this one out. Thank you.
enter image description here
Tried the formula but does not work, even if I remove every other formula:
enter image description here

Use a combination of AND and OR
Formula for Yellow (4x1, 1x4) =AND($G31=4, OR($D15=1, $D15=4))
Formula for Green (2x2) =AND($G31=4, $D15=2)
EDIT
As per your screenshot, if you are trying to change a range, not just cell G31, use the following:
Formula for Yellow (4x1, 1x4) =AND($G1=4, OR($D1=1, $D1=4))
Formula for Green (2x2) =AND($G1=4, $D1=2)
Change the number 1 for the starting row of your cells (3, 4, 5 whatever) and set the Range to be =$G$1:$G$100 again changing the 1 and 100 for your start and end row.
I cannot stress enough, if your data does not start in row 1, you will need to edit the above to suit your needs.

Related

Excel: Conditional formatting of whole row based on column value does not work

Suppose I have a simple dataset in Excel:
Column 1 Column 2
A 1
B 1
C 2
D 4
E 5
F 9
Now I want to mark the whole row with green color, if the value in column 2 is larger than 3. I apply a conditional format with the formula =$B2>3 applied on range =$A$1:$B$7 and it does not work:
One line where the value is 2 is marked green and one where it is 9 is not marked.
Now I want to mark the row, however only, if the value in column 2 is between 3 and 6. I apply the formula =AND(3<$B2;$B2<6) to the same range and it does not work:
Nothing is marked green.
Where is my mistake?
Update:
I now also tried =AND(3<$B1;$B1<6), but still nothing is marked green?
Change =$B2>3 to =$B1>3 which should work for you.
Your formula start range and apply start range must be same. Otherwise CF will highlight different cells.

Excel conditional formatting based on conditions

I am working on a personal project and have spent many hours researching colour formatting based on conditions. Unfortunately I have not been successful in achieving the end product.
I would be very grateful if anyone could help write a VBA code to address what I am trying to achieve below.
I have one named SaisieSO and two ranges. Range 1 (C:H) in which I enter six numbers and range 2 (N:R) in which I enter 5 numbers.
I would like in the worksheet in the Range (C: H) the cells to change colour based on the following conditions:
any cell in range (C:H) to be coloured red with white font if their value is equal to the value in N
any cell in range (C:H) to be coloured orange with black font if their value is equal to the value in O
any cell in range (C:H) to be coloured yellow with black font if their value is equal to the value in P
any cell in range (C:H) to be coloured blue with black font if their value is equal to the value in Q
any cell in range (C:H) to be coloured orange with black font if their value is equal to the value in R
I would like each time I add a new row with numbers in both ranges for the VBA code to colour the relevant cells as stipulated above.
Example
Range (C:H) six numbers Range (N:R) 5 numbers
Dates
C D E F G H N O P Q R
02/08/2019 16 14 11 5 15 7 4 8 6 3 7
07/08/2019 12 6 2 14 1 5 12 6 15 5 13
08/08/2019 14 10 7 6 13 8 14 10 12 7 9
09/08/2019 8 16 6 10 7 2 7 16 2 8 4
I hope you are able to provide me an answer
Many thanks in advance
Bruno
I'm advising you not to use VBA, but to do this using conditional formatting, the basic feature of Excel, as explained in this URL.
You can simply write a formula, and when this formula gives "TRUE", then the conditional formatting will be applied.
E.g. in cell C2 I've put a value, and in cell N2 I've put the same one. I've then created a conditional formatting rule, based on this formula:
=(C2=$N2)
When C2 equals N2 the result of this formula yields "TRUE", so the conditional formatting will be applied.
Why the dollarsign in front of column N? Well, you seem to want to use conditional formatting for the range C:H. When you drag to the right (e.g. for column D), your formula changes into:
=(D2=$N2)
As you see, dragging to the right changes your column reference from C to D, but the N is left fixed, because of the dollar sign. This is known as absolute cell referencing, and is explained here.

Excel Arrange multiple Columns

I have a data like this in excel:
1 1
1 2
2 2
3 2
And I want the result to be displayed like this:
1
1
1
2
2
2
2
3
Its like a ascending sorting. If the number in columnA <= columnB, it will be display first, at the same time, columnB will have a empty cell or blank value.
I have looked for this for a while but no one has the problem like this.
I would prefer a formula rather than VBA code.
Please advise, thanks!
Edit: I hope this explanation will be easier to understand
Data (A1:B2) - Result (C1:D4). Each number in Data (A1:B2) is a result of complicated formula so I cannot change its position
A B C D
1 1 2 1
2 3 4 2
3 3
4 4
Honestly, if you want to avoid VBA, here's a manual process that would give you the results you want:
Color each column (ie. Column A Red and Column B Blue)
Place values of column B under column A
Sort & Filter by Sort Smallest to Largest
Copy the contents of column A to column B
Last for Column A Find and Replace all* with format Blue then do the same for column B only with format Red. (See below for more info on how to do that).
Following those steps isn't the most conventional, but it will give you the results you wanted without VBA.
*Find and Replace based on font color:
1. Press Ctrl-H
2. Click Options
3. Click Format > Font > then select your font color > OK
4. With the Find What blank with the font color and the Replace With blank click Replace All.

Excel Formula if the value of a cell in one column stays the same but the value in another changes then show me

I hope you can help. In Screen Shot 1. You can see that the number 4424383
in column Y appears 6 times from row 2 to row 7
In column U you can see the numbers 12345 and 76259 and they also appear from rows 2 to 4 and 5 to 7
What I need is a formula that can produce a piece of text that says "Investigate" in column Z, if the number in Column Y stays the same but the number in Column U changes.
If you look at Screen Shot 1 you will see the green number 4417458 in column Y and the green number 76260 in column U this DOES NOT need to be investigated.
Like wise with the purple numbers
Its only when the HUB_PARTY_ID or Y number continues to be the same but then the MTNG_ATNDEE_ID or U column number changes that I need "investigate" to appear in the Z column.
as always any and all help is greatly appreciated.
Screen Shot 1
This should do it:
=IF(Y2=Y1,IF(U2<>U1,"Investigate","Cool"),"Cool")
You can use the below formula starting with the third row of column Z
=IF(AND(Y3=Y2,U3<>U2),"Investigate","NA")
Result:

Microsoft Excel 2010: Help making a Formula to up Values by a repeating pattern

I have a Spreadsheet, and inside this sheet contains a column with numbers, I want to make a formula that will go down that Column and do basically this.. Values: 1 will be 9.50. 2 will be 9.75. 3 will be 10.00. Ect going up to Value of 100? Is that possible for a Formula? I keep playing with it but can't really seem to get it down. Any help would be appreciated.
Column A: 1
1
1
1
1
2
2
2
2
2
2
2
2
2
3
3
3
3
There is not a set amount to how many values are in there.
this should do it supposing that column A has these values 1, 2 ...etc that your computing will be based on
=MIN(9.25+A1*0.25;100)*COUNT(A1)
In A2, enter the formula
=A1 + (9.5-A1)
then in the cell just below it (A3), enter
=A2+0.25
Assuming A1 is the top left. Copy the formula in A3, select the next 399 cells and paste. Then select A2 - A364 and copy. Then select B2 -xx364 and paste. xx is the last column with data. If you want, set the height of your first column to 0 to hide it.
=(A1-1)*0.25+9.5 where A1 contains any number you want

Resources