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", ...
Related
I want to make a table that can calculate the cost per week, per month and per year of any value.
If the per week value is entered it needs to calculate the per month and per year value.
If the per month value is entered, it needs to calculate the per week and per year value.
If the per year value is entered, it needs to calculate the per week and per month value.
I can only use three cells.
I haven't a clue how to do this. I don't even know how to run the code in Excel. I heard you have to use VBA but I have never touched Visual Basic let alone, used in in Excel.
Please can some one help. This is very important to me. Thanks in advance for any help :)
Going with a more formula driven route, I would suggest using an input range and a result range. In the attached screenshot, the blue cells are for inputs while the below formulas go i the row below the inputs.
For days
= if(not(isblank(A8)),A8,if(not(isblank(B8)),B8/30,C8/365))
For months
=if(not(isblank(A8)),A8*30,if(not(isblank(B8)),B8,C8/12))
For years
=if(not(isblank(A8)),A8*365,if(not(isblank(B8)),B8*12,C8))
Note1: I assumed 30 days a month and 365 days in a year.
Note 2: The order the formula calculates is first days, then months, then years. So, if something is in days it will need to be cleared out when inputting months and so on.
I am building a template for a data entry spreadsheet at work for some of the old-timers. The template that they will see will be columns of categories and the rows will be dates including the day of the week. I know how to auto-fill the date an day by drag and drop, but honestly some of these guys even screw that up. So, I am building this spreadsheet that auto populates the date and the day for the whole month based on entering the first day of the month that way its as simple as possible, but I am having trouble with the 31st day of some months. I don't want to have two different spreadsheets. Right now the code that I have is:
=EOMONTH(A5,0)
This works if it is the 31st day of the month, which is great, but if it is not a month that has 31 days it repeats the 30th day. I'd really like it to be an if statement, but I know my code is off because it always generates a FALSE.
Is =if(A5(M<2),"EOMONTH(A5,0)") heading in the right direction? It generates a #REF! reponse with that code.
Thank you for any input!
In A5 enter the date of the first day of the month. In A6 enter:
=A5 + 1
and copy downwards.
In A35 enter:
=IF(DAY(A34+1)=1,"",A34+1)
This assumes that you are making the date sequence by adding 1 to the cell above.
EDIT#1:
Put this in A6:
=IF(A5="","",IF(DAY(A5+1)<DAY(A5),"",A5+1))
and copy downwards through A35.
This will handle long months, short months, leap years, etc.
(this also has the advantage of maintaining the same formula for the entire set of cells)
You just need to add an IFERROR before the IF to fix the February problem:
=IFERROR(IF(DAY(A34+1)=1,"",A34+1),"")
I am looking to have a formula automate some bottom boarders.
The scenario is that I have a schedule that creates weeks which is already formula driven to continue down but wish to automate the month changes where the majority of a week lies in the previous month.
So if one starts on 12th feb the 19th would be the ending week due to the 26/2/18 having the majority of a week falling in March.
Does this need to be macro driven as I'm not too sharp on those.
Any help would be appreciated.
Thanks
Shaun
With data as shown, where shown, I applied the red lines with a Conditional Formatting formula rule of:
=EOMONTH(A1,0)-A1<3
Applied to ColumnA.
hopefully you can help me with this. I've been trying to figure it out in Excel myself, but I can't make the functions work and it's causing me to manually count the cells.
I've created a sample sheet on Google to show roughly what I'm trying to do;
https://docs.google.com/spreadsheets/d/18bFBvtbK-3JDj6Z6_b6NHttaytApNvdfw92ZcI4ECws/edit#gid=0
I have a series of tests my personnel have to take annually, and I want to write a function that displays the total number of tests taken within the past year. Cell B1 would be the column title, B2-4 would display the date the test was taken, and B5 is where I want the number of dates in B2-B4 that are less than one year old.
Any ideas?
If you want less than a year old from todays date then just count all values that are greater than 365 days ago,
=COUNTIF(B2:B4, ">"&(TODAY()-365))
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)