Excel with 3 IF conditions - excel

I am creating a template with 2 sheets in excel. Sheet 1 has the overall project status and sheet 2 has the list of projects with columns -Example B2 to H2 with Red and Green cell format.
If any of the cell in C2 to H2 is red for a particular project, then the overall project in sheet 1 is red. I used the following formula;
=IF(OR('Apr 6 Obeya worksheet'!$C$2="Red",'Apr 6 Obeya worksheet'!$D$2="Red",'Apr 6 Obeya worksheet'!$E$2="Red",'Apr 6 Obeya worksheet'!$F$2="Red",'Apr 6 Obeya worksheet'!$G$2="Red",'Apr 6 Obeya worksheet'!$H$2="Red"), "Red", "Green")
In the formula above, red is a true value and green is a false value.
So in sheet 1 the overall project status cell is highlighted in green when the cells C2 to H2 are not highlighted in Red or Green (Cells are blank)
What is the formula to use when the cells in sheet 2 (C2 to H2) are not highlighted and the cell (overall project status) in sheet 1 is not highlighted in green. I want that cell to have a default color (White)
I am using excel 16.
Thanks for your help.

Related

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.

Highlighting only 1 cell above and 1 cell below the relative value

I want to highlight only 2 cells, 1 above and 1 below, closest to the relative value.
For example, my relative value is cell A5, I want A2 and A4 to be highlighted.
A
1 7
2 6
3 -2
4 1
5 5
I tried conditional formatting =ISNUMBER(MATCH(ABS(A$5-A1),SMALL(ABS(A$5-A$1:A$4),ROW($1:$2)),0)). However, it highlights 2 cells that are closest to the relative value, regardless of direction/magnitude. In this case, A1 and A2 were highlighted.
Next smallest:
=(A1=LARGE(IF($A$1:$A$5<A$5,$A$1:$A$5),1))
Next largest:
=(A1=SMALL(IF($A$1:$A$5>A$5,$A$1:$A$5),1))
However if there's a tie then all matches would be highlighted.

Bottom Up reference in Ms Excel

I'm doing seating arrangement for an exam.
Sheet1 - A1:A5 (Contains Roll numbers)
1
2
3
4
5
I want this in Sheet2 Bottom up reference from another sheet
Sheet2 - A1:15
5
4
3
2
1
I did This
1. In Sheet2 A5 =Sheet1:A1
2. In Sheet2 A4 =Sheet1:A2
3. Dragged up after selecting these two cells.
This is not working.
Put following formula to Sheet2 A1 cell then drag and down
=LARGE(Sheet1!$A$1:$A$5,ROW(1:1))

Excel Conditional Formatting Formula

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.

How do I link the content of a cell to another worksheet as opposed to the value?

I realize my title doesn't really explain what I'm asking as I don't know the correct terminology but bear with me and I'll explain my question.
I know how to link two cells so that if one changes, the other does as well (i.e. cell C3 is linked to cell E5 by selecting cell C3 and entering "=E5"). But how do I link the information in the cell to another cell?
If my worksheet looks like this:
cell B1 - Grapes, cell C1 - 50
cell B2 - Apples, cell C2 - 60
and I link cell F1 to cell C2 with "=C2". If I change the order of cell B1 and cell B2 to become alphabetical then cell F1 is no longer linked to the value in cell C2 (50) but changes to the value that now becomes cell C2 (60). How do I link cell F1 to the actual value (50) in cell C2 even if the order changes.
Help... Thank you!
Not sure if this is an efficient method; if i correctly understood your question then you can use = to link two cells For example:
Sheet one can look like this
A B C D E
1 1 2 3 4 5
2 5 4 3 2 1
3 1 2 3 4 5
Total 7 8 9 10 11
Sheet two requires cell links so you do:
TotalForA =Sheet1!A4 //output will be 7
TotalForB =Sheet1!B4 //output will be 8
.
.
.
In a simple word you can use = sign and click on whatever cell you're like to get.

Resources