How to use conditional formatting for values that are a certain amount higher than the above cell? - excel

I'm having trouble using Conditional Formatting in Excel. I am inexperienced so apologies if this is an easy fix.
Basically, I have a table of accounts, and the number of orders they have in a matrix style. For each order they make, the number of days since they made that order is added into the table.
Order Quantity is the order number, so the 9th order Clara made was 2416 days ago
I wanted to show that if, for example, Abbie's 3rd order was over a year after her 2nd order (which it is), then highlight it red. If it's between 6 months and a year, yellow, and if it's under 6 months to make it green (if it's possible to have more choice that would be even better, so last 30 days, 90 days, etc.).
However, when I write this into the formula section of the conditional formatting area, and drag the formatting down, the cell numbers stay the same, so they would all base their values on whether the 5th, 6th, 7th orders were over a year since her 2nd order.
I wanted to make it to show the 3rd against 2nd, 4th against 3rd, 5th against 4th and so on. (And obviously I would like to do this with all accounts). How would I go about this?
The only way I can even think of it working after the problems I've had is to do them all individually, which would be very time consuming.
=$J$5 < $J$4 - 365 is the formula that is written. I've gotten rid of the $ but they automatically reappear, and even when they don't, the cells don't change.

This time I'll translate for the non-fake-German speakers..
The formula should not be with absolute references when the conditions aren't absolute, i.e. $B$2<$B$1-365 over the range =$B$2:$G$13 would color all cells in that range red since B2 is in fact smaller than B1 - 365
The formulae in English:
AND(ISNUMBER(B1),B2>B1-180)
AND(B2<B1-180,B2<B1-365) (yes, I had
360 in the img, don't ask why)
B2<B1-365 (no change there ofc)

Related

Trying to correctly duplicate formulas keeping same cell range but adjusting date ranges

I'm trying to help someone with an Excel spreadsheet of sales figures. I hope this explanation is clear. She has a worksheet for each category of items she sells, such as clothing, shoes, furniture, &c. Each worksheet has a column, G, for Date Sold, and the data is in Date format.
On a summary worksheet, she wants to aggregate and analyze the data, and one thing she was doing manually was counting the number of sales of each category for each month (sometimes zero).
I helped her write a formula to pull the count from the clothing worksheet, for the month of March 2019 into a cell on the summary worksheet:
=COUNTIF($CLOTHING.G3:G502;">2/2019")-COUNTIF($CLOTHING.G3:G502;">=4/2019")
This correctly yields 5. Cool. But that is just one month, and we need twelve for each year, for multiple years, and we have six categories. So we'd rather not hard-code each formula every time we need a count.
When we tried to copy the formula into cells below (for April, May, etc), hoping it would adjust the dates, it wrongly adjusted the cell range to G4:G503. The cell range shouldn't change; the months should advance, but they did not change.
We've been trying different suggestions we found online, such as naming the range G3:G502 but it didn't like that. We got an error.
We both (obviously) have a limited knowledge of Excel. Please let me know what we're doing wrong OR if there is a better way to approach this, and how to do it step by step. Please ask any questions if my explanation is not clear.
Using your formula I would adjust it as follows:
=COUNTIF($CLOTHING.G$3:G$502;">="&DATE(2019;row(1:1);1))-COUNTIF($CLOTHING.G$3:G$502;">"&EOMONTH(DATE(2019;row(1:1);1),0))
Note the addition of the $ to the cell reference. This keeps either the column or row from change when a cell is copied.
Row(1:1) will return 1 in the first cell it it entered into and as it is copied down will increase by 1. Therefore it is important not to copied it down more than 12 rows from its initial entry point.
Note the year in the date is hard coded. Alternatively the year could be placed be place in a cell and a reference to that cell could be used in place of the hard coded year. That way in subsequent years, you would just change the value in the cell instead of changing your value in the hard coded formula.
Note this solution assumes January for the first cell and months following sequentially to December for the 12th cell.
I my system is configured to use , as separators instead of ; so it is possible I may have made a mistake with those in my edits.
Alternatively you could look at COUNTIFS. It is similar to COUNTIF but requires all entries to be TRUE for an entry to be counted.
=COUNTIFS($CLOTHING.G$3:G$502;">="&DATE(2019;row(1:1);1);$CLOTHING.G$3:G$502;">"&EOMONTH(DATE(2019;row(1:1);1),0))

Consecutive days absent in row

I'm currently trying to make a comprehensive attendance list to be used by my colleagues. One of the questions I got from one of them was, if it was possible to highlight a name of a person who has been absent 3 consecutive times on a given day.
So, the way my sheet has been set up is that in row 1:1 there’s the dates of the lessons. They are held on Tuesdays and Thursdays. On row 2:2 it gives the day, so it goes from tue, to thu, back to tue until the end of the year.
Column A:A contains the names of all the students the caveat is that, the students that follow the lessons on Tuesday are different than the ones on Thursday, so the cells with the absence will never be adjacent to one another.
Now is there a way, with conditional formatting or other, that I can highlight a students name, who has 3 consecutive A’s behind their name?
Okay, I gather from your post that you are marking absences with an "a" in the cell of the absent date, and each student will only be expected to attend on either Tuesdays or Thursdays, e.g. every other cell in the row. I'm also assuming you'd want to continue highlighting for additional consecutive absences. This is what I came up with, hopefully it works for you.
Highlight the range of cells you want to apply the conditional formatting to.
Conditional Formatting -> New Rule -> Use formula to determine which cells to format -> =AND(B3="a",XFD3="a",XFB3="a")
This worked for me as demonstrated in the below image. Let me know if you need any adjustments and I'll see what I can do.
image

Distribution line excel formula

I require a formula which will redistribute previous months values dependant on the current month. (this will always be staggered by 2 months I.e. if the current month is June it will redistribute May and Aprils percentages to the remaining months based on a percentage already calculated.
Please see picture below which will aid my explanation of what is required.
Taking June for example the 2% and 3% for April and May would be re-distributed to ensure the summary column always = 100% however distribution would be calculated based on the % of the distribution line.
The formula I am currently using is;
=IF=(($E$19+$F$19)*G19)+G19
However I assume this needs to be nested into IFS statements to ensure the formula is always staggered by two months and does not take into account any previous months however I am not sure how to do this
This goes into cell G21, and can then be copied into H21:P15 via pasteSpecial>Formulas:
=G$15/sum($G$15:$P$15)
In row 22, you would have:
=H$15/sum($H$15:$P$15)
You would have to modify the formula in this way for each row.

Need to select a range of cells based on a cell's value

Here is a little backstory on what I am trying to do. First, I am NO Excel expert by an means, but I am a rather quick study and have been able to figure out things as I go.
I created a daily tracking spreadsheet (that I should probably use Access for...) that tracks how many employees worked, type of work they did that day, who didn't work, etc. Most of the cells are color coded, contain specific text or numbers (a LOT of Conditional Formatting is also applied).
The code that I need help with is currently hard coded to look at a specific column and a specific range of cells. I need the code to be able to select the range of cells based on the current date, which is listed along the 3rd row from the top.
So instead of this: =IF(COUNTIF(Y4:Y61.... I need Y4:Y61 to be a formula that determines what cell the current date is in and calculate in that specific column's range of cells.
thanks in advance
Patrick
For COUNTIF() you could simply add the date column being for today as a criterion.
Assuming you want a more general approach you can use the OFFSET() formula as you can specify the position and size of the range.
Consider a sheet like this
A B
1 2015-10-27 1
2 2015-10-27 1
3 2015-10-28 1
4 2015-10-28 2
5 2015-10-28 1
6 2015-10-29 1
and today is the 28th of October
You can sum column B by using
=SUM(OFFSET(A1,
MATCH(TODAY(), A1:A6, 0),
1,
COUNTIF(A1:A6,TODAY())))
What this does is:
move the reference of A1 to the row where your entries from today start.
It then takes one column of width.
We then give it a row height being the number of entries for today making the formula return 4 today and 1 tomorrow.

How To Ignore Blank Cells for a Formula

I'm tracking hours for my company and I need to see the updated hours daily. I have everything formatted how I want it, except I want two columns to show how many hours over and under each employees current hours are.
What I have right now is
=(D3-C3)+(F3-E3)+(H3-G3)+(J3-I3)+(L3-K3)+(N3-M3)+(P3-O3)
But it is including all the empty cells (for days that haven't been worked yet) as a zero.
I want a formula that can allow me to ignore those blank cells until they have content.
I can't just use a SUMIF >0 function because I need to count the number of hours employees have MISSED (i.e. scheduled 12 hrs, actually worked 0).
Here's an alternate approach to #Tom's, though it works on similar principles. This one, however, relies on your ability to add a couple of 'HELPER' rows, above your current data.
I'm assuming that row 1 will alternate between saying "PROJECTED", and "ACTUAL".
I'm assuming that row 2 will be dates for that week, in Date format. So A2 will be Jan 1 2015, B2 will be Feb 1 2015, C3 will be Feb 1 2015, or however often the time blocks go up. The key here is that the PROJECTED columns and the ACTUAL columns will each need the date in them.
The formula to check the variance between that row's PROJECTED amount and that row's ACTUAL amount, only for dates prior to today, is (for row 3 and copied down, and assuming the data goes to column Z):
=SUMIFS(A3:Z3,$A$1:$Z$1,"PROJECTED",$A$2:$Z$2,"<"&TODAY())-SUMIFS(A3:Z3,$A$1:$Z$1,"ACTUAL",$A$2:$Z$2,"<"&TODAY())
This checks to see the value of PROJECTED columns for that row, where the date is less than today, and subtracts the value of ACTUAL columns for that row, where the date is less than today.
If you are looking to compare with something other than TODAY(), you can set up a cell to be your 'comparison point'. Manual type the breakoff period you are concerned with into that cell, and replace "&TODAY()" with, say, "&AA1" [assuming your breakoff point is entered in cell AA1].
As it stands, either a very long series of IF's and OR's or an array formula:-
=SUM(IF(OR(D3="",C3=""),0,D3-C3),IF(OR(F3="",E3=""),0,F3-E3),IF(OR(H3="",G3=""),0,H3-G3),IF(OR(J3="",I3=""),0,J3-I3),IF(OR(L3="",K3=""),0,L3-K3),IF(OR(N3="",M3=""),0,N3-M3),IF(OR(P3="",O3=""),0,P3-O3))
=SUM(D3:P3*ISEVEN(COLUMN(D3:P3))*(C3:O3<>""))-SUM(C3:O3*ISODD(COLUMN((C3:O3))*(D3:P3<>"")))
The second one must be entered with CtrlShiftEnter
Note that it could easily be broken by insertion/deletion of columns.

Resources