Fellow Excel Enthusiasts,
I'm looking for a way to use conditional formatting to check if my invoice should be payed.
Added picture is how my data looks at this point in time.
What I am trying to achieve, is that when in column J the value (=weeknumber based on 25 days after date in column H) equals the week we're in, it should color the full row and keep it like this.
I've achieved the full row with conditional formatting, but still remain with 2 problems.
How to determine if this value in Column H is the same as the week we're in now? How do i keep my conditional formatting, so that when it is week 8 this row with week 7 remains coloured?
If conditional formatting is the wrong way to go, please tell me. I am learning, and would like to learn, not just a straight up answer how to fix my problem.
Using WEEKNUM you can use the following:
=WEEKNUM(H4+25, 2)<=WEEKNUM(TODAY(), 2)
The 2 in WEEKNUM indicates which day of the week to take as the first, after 1st January (which is week 1)
Related
I have a spreadsheet that is used to track hours. I am trying to change the color of the cell that has hours greater than 0 but only for those hours less than today's date based on their column.
Here is a screenshot
What I am trying to get it to do is to look like this, as the date changes each day the hours behind it are grayed out.
I can't get the conditional format formula to work. I have tried
=AND($F$25:$JB$25>0,$F$23:$JB$23<TODAY())
=IF($F$23:$JB$23<TODAY(),"",$F$25:$JB$32>0)
=AND($F$25:$JB$25>0,INDIRECT(ADDRESS(ROW(), COLUMN()-1))<TODAY())
Where row 23 is where the dates are and 25-32 are the hours
Any ideas? I'd like to do this without a macro if possible
Not sure if my brain is frazzled after a long day but I just can't get this issue with conditional formatting fixed...
I have created a calendar in Excel which auto-populates week days based on the year (also accounts for leap years too) though I am trying to get the table cells to turn a different colour if it happens to be a weekend. The month's days are typically populated by the formula =TEXT(WEEKDAY(DATE(CalendarYear,1,n),1),"aaa") where n is the relative day in the month.
Each month is in its own tab/sheet.
To highlight the weekend, I am currently using the simple formula =OR(B2="Sat",B2="Sun") -
this is applied to the whole table contents =$B$4:$AF$60 BUT only the first row (row 4) seems to actually work - see image below.
Annoyingly everything else works fine bar this one bit and I just can't process why this is happening... The days will vary based on the year value; if I alter the year value row 4 works as expected with the greyed blocks shifting with the weekend days.
Any pointers/help is greatly appreciated.
Thanks
Change your formula from:
=OR(B2="Sat",B2="Sun")
into:
=OR(B$2="Sat",B$2="Sun")
Otherwise, it will point at "B3", "B4", ...
I have a spreadsheet where I calculate data by day for 3 week periods. Each day is compared to the previous day so I can see fluctuations in each row from day to day. I use conditional formatting to highlight positive or negative fluctuations assigning any negative values that appear as red text and any positive values as green. I only ever manually enter data into the columns for the specific days and allow excel to do the "heavy lifting" of subtracting one cell from another and then conditionally formatting based on the result. I've run this spreadsheet for over a year now, again working in 3 week increments, and in each of those 3 week sections the same column that represents day 4 (Column G in the screen shots) has the same problem. I've ignored it for over a year and now I can't take it anymore.
Here's the issue. I have no conditional formatting assigned to any of the columns that I type into, the columns represented with "Day #" in the screenshot of my spreadsheet. But yet when I get to Day 4 and type any value into that column it gets the conditional formatting applied to it that only the columns that display my differences should have.
NOTE: These screenshots are of a test instance of this problem that I created thinking the issue might be with my original file, but I was able to recreate the problem with a completely new spreadsheet.
I've had times where I've checked my conditional formatting 'Applies To' field prior to making any change to column G just to ensure that column, or any of its cells, aren't listed. Then the moment I put a value into that column the cell I typed in gets added to the 'Applies To' field. This only happens to this column, no other column on the spreadsheet.
Here's what I think I've found and I can't see a way around it, and unfortunately I think I need to get pretty detailed with what the spreadsheet does to really explain what I think is happening.
Column A - Row title - no formulas
Column B - Represents Day 1 values - no formulas
Column C - Represents Day 2 values - no formulas
Column D - Represents the difference between day 1 and 2 - =C2-B2
Column E - Day 3 values - no formulas
Column F - Difference between day 2 and 3 - =E2-C2
Column G - Day 4 values - no formulas
Column H - Difference between day 3 and 4 - =G2-E2
Column I - Day 5 values - no formulas
Column J - Difference between day 4 and 5 - =I2-G2
Columns K through AD - remaining days and differences columns to represent the remaining days to get through 15 days worth of values and differences
What I think is happening, and what I can recreate, is that Excel is getting confused at the fact that I have a pattern of conditional formatting for every other column, but that the first two columns where there's no "Difference" column between them (columns B and C) I have no conditional formatting and it tries to recreate that pattern in column G the moment I start typing values into that column. I can recreate this exact same issue no matter what the columns are, once I reach the 6th column in my pattern excel adds cells that I type values into to the conditional formatting rules.
Has anyone else ever seen this? Any ideas on how to avoid it? I thought it was related to copying and pasting my sections as we start a new 3 week period but the fact that I can recreate the issue from scratch consistently removes that theory. Any help or ideas would be appreciated. The work around is of course simple enough but now I'm just curious as to what is causing this.
Blank spreadsheet prior to applying any values to any days. All of the formulas and conditional formatting is already applied to the Differences columns.
At this point I've entered values into the columns for Days 1, 2 and 3. Note how the conditional formatting dashed lines don't include anything for Column G cells.
After entering 2 values into cells in Column G those cells now appear in the Applies To fields for both of my conditional formatting rules.
If someone can explain this I will send them all of the high fives I have.
For a proper explanation could mean asking Microsoft because you may have analysed the behaviour to about the extent possible without inside knowledge.
However there are two simple workarounds. One is to apply a pair of rules for ColumnD that differ from the rules for the other columns. The other, my recommendation, is to rearrange the difference columns so that each falls between its start/end points. So the first would be in ColumnC with formula:
=D2-B2
copied down to suit.
Then for conditional formatting select ColumnsC:AD, clear existing formatting and and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(ISODD(COLUMN()),C1>0)
Format..., select green font, OK, OK.
Then for red font apply:
=AND(ISODD(COLUMN()),C1<0)
Since this way the Applies to range is unbroken (=$C:$AD) Excel will not be tempted to 'interpolate' for you.
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.
I am trying to create an excel formula that will increment as the year changes. The following is what i am trying to do:
http://i58.tinypic.com/nbc1fc.jpg
I have 2 columns - date and id.
What i would like to do is increment the ID column by +1 when the year changes in the date column. So, dates from the same year will get the same id. (i am not concerned by the month/day values, all i need to do is assign the same id to dates from the same year).
I have tried a variety of formulas in excel but my excel skills are not great and i have been unable to find a solution. The best i could come up with is:
IF(YEAR(A1=1928),420) but that would be quite monotonous to do for every year in the excel file.
i did try to do a bit of research and the only similar question that i could find on here was this -->
Increment number when Date changes
Any help would be much appreciated
Please try, in say B2 assuming your data starts in A1:
=IF(YEAR(A2)=YEAR(A1),B1,B1+1)
and you have chose a value for B1. Copy down to suit.