Conditional Formatting (If/when) - conditional-formatting

Ok so I want a row to highlight red when the date in cell C1 is more than the cell in B1, but only if this is a difference of two months or less. I am sorry, I don't know how to embed a dummy spreadsheet. So for example, if B1 (clinic appointment due date) is Sep-17 and C1 (physical checks due date) is Oct-17, I want this row to highlight. If C1 is Dec-17, I don't want the row to highlight because this is more than two months from Sep-17.

Edited based on your new description, using Column A to represent Clinic Appointment Date and Column B to represent Physical Checks Due Date.
Use a rule based on DAYS().
Click on cell A1
Choose New rule from the Conditional Formatting menu.
Choose Use a formula to determine which cells to format
In Format values where this formula is true:, use the below formula:
=DAYS(B1, A1) < 60
Set up the formatting you want to use to highlight the cells. In the image below, I've set the ones that meet your requirements for highlighting to appear in red, and applied it to the first two rows in Column A (A1 and A2):
Here's the sheet with sample data in two rows, showing the conditional formatting working as requested:

Related

VBA: select all the cell from a specific one to the last with values

My aim is to select with VBA for example all the cells from A1 to A10 (the last one with values).
Is the function AllValueDowns applicable? If so, how does it work?

How to replace an empty cell in formula with last numbered cell

Working on a budget worksheet. I am trying to get the cell to keep looking up the column for one part of the formula if the previous cell is blank.
I currently have the formula to give a blank cell in the 'Remaining' column (E) if the 'Budgeted' column (C) is blank, as seen here
Budget clip
The issue comes when trying to get a number in the 'Remaining' column when the previous cell above is blank. I would like it to keep looking up the column until it finds a number, then use that number in the equation.
So in the picture, for Expense 5 (A9) I would like it to take cell E6-C9.
And then repeat the formula down the column.
I would like to copy the formula down the column since filled and unfilled cells will change from month to month.
Try this in cell E9
=IF(C9>0,$C$3-SUM(C$5:C9),"")
I think this will serve the same purpose as calculating E6 - C9 (i.e. calculating how much of the budget is remaining), but it's simpler code.
You should be able to copy it from E5 to the bottom of your table using regular copy-and-paste.

subtract the last two non-empty cell in excel

This is I think a simple problem but I can't seem to find the right solution for it. I don't know if VBA is needed for it. Basically I just want to subtract the last two non-empty cell in Excel. Example: I have the cell A1 and cell B1 and then subtract the value of A1 from B1 and place this value at the same row but another column C1 and so on. I have read this to get the last non-empty cell but I need two non-empty cell and perform operation on them.
=LOOKUP(2,1/(A:A<>""),A:A)
Is there an easier way to do this? Or should I use VBA?
EDIT:
the reason is I'm making a somewhat similar to a balance sheet but a simple one, the user will just enter deposited value at the first column and expenses at the second column and then display the balance in the third column.. and vice versa.
EDIT:
Sample
Put this in C4 and copy down:
=SUM($A$3:$A4)-SUM($B$3:$B4)
If you want to copy the formula past the data so it will automatically fill when data is inserted you can do what #Dirk stated:
=IF(A4&B4<>"",SUM(A$3:A4)-SUM(B$3:B4),"")
Put it in C4 and copy down as far as desired.
This way you can fill the column with the formula and as the data is filled it will change from the empty string to the running total.
EDIT:
Regular formula:
=IF(ROW($C1)=1,OFFSET($C1,0,-2)-OFFSET($C1,0,-1),OFFSET($C1,-1,0)+OFFSET($C1,0,-2)-OFFSET($C1,0,-1))
in cell C3 put "=A3-B3" in cell C4 put "=C3+A4-B4" then copy down.
This will start the balance at 3000 in C3 then add any deposits or minus any withdrawals to the rest of column C.

Alternate Cell Color in a column B for particular range say B67 to B323

I need to color alternate cells in a column in Excel via vb,basically requirement is if B1 value is selected like4/6/8/10/12 a table gets generated (done) and then with a particular pattern cells should be colored.I have done manually for few of them but requirement is to color alternate cells from B67:B323 in a column B.
There's no need for VBA for this. Use conditional formatting instead.
=MOD(ROW(),2)=0
MOD(ROW(),2) will return 1 for odd numbered rows, and 0 for even.

How to display a value of a cell using the LARGE formula feature

In Excel using the LARGE function I have listed the top five values in the range of cells C2:C13 into the cells F2,F3,F4,F5,F6. I used the following formulas in the corresponding cells to do so:
Cell F2 I used this =LARGE(C2:C13,1)
Cell F3 I used this =LARGE(C2:C13,2)
Cell F4 I used this =LARGE(C2:C13,3)
Cell F5 I used this =LARGE(C2:C13,4)
Cell F6 I used this =LARGE(C2:C13,5)
Here is a screenshot:
However, what I would like to do is to display the value of the cells to the left of the five greatest values. Below is a screenshot of how I would like it to work if possible:
Please try:
=INDEX(B:B,MATCH(LARGE(C$2:C$13,E2),C:C,0))
in F2 and copy down.
If purely for display purposes you might filter ColumnsB & C an apply a "Top 10..." selection for 5 items.
We could 'cheat' and manage without INDEX in the example provided but, for wider applicability, having chosen the top five values in ColumnF these are then MATCHed to their row numbers in ColumnC and the corresponding row number fed in to the INDEX function to determine the B value.
The following is tested in Google Spreadsheets.
This would be a simple solution:
=MATCH(LARGE($C$2:$C$13,1),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,2),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,3),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,4),$C$2:$C$13)
=MATCH(LARGE($C$2:$C$13,5),$C$2:$C$13)
Another more precise way:
=LOOKUP(LARGE($C$2:$C$13,1),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,2),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,3),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,4),$C$2:$C$13,$B$2:$B$13)
=LOOKUP(LARGE($C$2:$C$13,5),$C$2:$C$13,$B$2:$B$13)