Adding bottom border to dates in formula - excel-formula

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.

Related

Conditional Formatting To Highlight Calculated Weekends

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", ...

Auto populating the 31st day of a given month in excel

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),"")

COUNTIF formula using variable dates

Morning all,
Let me explain my predicament! I'm putting together a set of reporting figures for my employer based on a spreadsheet containing work that's been completed so far this year. I need to report on the total volume of work completed and the average turnaround for this work, split by Week to Date, Month to Date, and Year to Date (WTD, MTD, YTD).
This is something i've put together manually so far but i want to produce a formula which allows my employer to generate his own figures based on a week-ending date he can pick from a dropdown list (held in cell D4).
So far i've been able to generate the below COUNTIF formula to give me the WTD figures for work volumes completed within 7 days of the week ending date in cell D4 (with the completion date being held in 'Completed!O:O'):
=COUNTIFS(Completed!$O:$O,">="&D4-6,Completed!$O:$O,"<="&D4+1)
I'm also using the below AVERAGEIF formula to show the average turnaround (the Turnaround figure is held in 'Completed!P:P'):
=AVERAGEIFS(Completed!$P:$P,Completed!$O:$O,">="&D4-6,Completed!$O:$O,"<="&D4+1)
I've been trying to come up with similar formulas to tell me the MTD and YTD figures but with no success. I originally had the MTD formula return the value based on work completed within 31 days of the Week-Ending date but this was incorrect. If the week-ending date of 03/02/2017 if selected then i only need it to show the count of work completed between the 1st and 3rd of Feb. I'm sure once i work this one out that i'll be able to use a similar formula to show me YTD figures.
Any help or guidance you can offer is appreciated! Cheers.
For the MTD count, use:
=COUNTIFS(Completed!$O:$O,">="&DATE(YEAR(D4),MONTH(D4),1),Completed!$O:$O,"<="&D4+1)
For the YTD count, use:
=COUNTIFS(Completed!$O:$O,">="&DATE(YEAR(D4),1,1),Completed!$O:$O,"<="&D4+1)
For the MTD average, use:
=AVERAGEIFS(Completed!$P:$P,Completed!$O:$O,">="&DATE(YEAR(D4),MONTH(D4),1),Completed!$O:$O,"<="&D4+1)
For the YTD average, use:
=AVERAGEIFS(Completed!$P:$P,Completed!$O:$O,">="&DATE(YEAR(D4),1,1),Completed!$O:$O,"<="&D4+1)
a fellow helpful user has assisted and i now have formulas that work.
For MTD, i'm using the following:
=COUNTIFS(Completed!$O:$O,">="&EOMONTH(D4,-1)+1,Completed!$O:$O,"<="&D4+1)
And for YTD:
=COUNTIFS(Completed!$O:$O,">="&DATE(YEAR(D4),1,1),Completed!$O:$O,"<="&D4+1)
Thanks for everyones help!

Conditional Formatting based on weeknumber

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)

Retrieve cell value based on date Excel

I'm working on a time sheet for my work schedule. In column A I have the start dates of each week. In the second column I have how many hours I work that day. I am payed on the 22nd of each month. I want to have a running total of how much I have earned in a month before payday. That is to say on the 21st I know how much money I will be paid the next day from my spreadsheet.
I want to SUM the values of column B but only for the weeks which lie between the 22nd of 'April' lets say and 'May'.
Therefore based on the value of the start date of the week, I need to obtain the information adjacent to the weeks, for a set of weeks and sum it to find the number of hours I've worked this paying month. I want this to happen automatically, so it will change automatically.
I have attached a screenshot which might make this clearer, I have added a couple of other names as additional variables.
Thank you in advance,
Maksim Richards
If the amounts that you'll get in next month's pay haven't been filled in yet (which is the question you're asking because you want to find out on 21st May how much you will be getting) then you just need to sum the amounts for the weeks starting 22/4/16 onwards in G9:-
=SUMIF($A$4:$A$11,">="&DATE(YEAR($F$2),MONTH($F$2)-1,$G$2),B$4:B$11)
where today's date is in F2 and payday in G2.
Then the pay so far is:-
=G9*24*$H$2
where the hourly rate is in H2 (result may appear formatted as date: if so, change format to general).
If you wanted to check back after some of next month's hours had been put in the spreadsheet and see if what you've actually been paid is the same as your calculated pay you would need a SUMIFS:-
=SUMIFS(B$4:B$11,$A$4:$A$11,">="&DATE(YEAR($F$2),MONTH($F$2)-1,$G$2),$A$4:$A$11,"<"&DATE(YEAR($F$2),MONTH($F$2),$G$2))
I haven't used TODAY to get today's date because it's volatile and if you use it, it will keep prompting you to save the spreadsheet when you close it even if you haven't changed anything.

Resources