Match column then step back to grab data - excel

I am calculating Earned Value (EV) and Planned Value (PV) by pulling the estimated and scheduled completed work. The formula below works as it should with one minor hiccup, it pulls the data for this on going pay period based on my =Today() cell, making it look like my Scheduled Variance is behind as there are no hours entered yet.
My thought process is as follows.
Reference the cell with =Today() Use that to look at the start and end dates for the pay period. Then move back to the previous period once it finds a match.
=LOOKUP($B$1,1/('Labor-AC_EST'!$E$43:$AE$43<=$B$1)/('Labor-AC_EST'!$E$44:$AE$44>=$B$1),'Labor-AC_EST'!E45:AE45)

Related

Formula which subtracts a cell value from a total based on the date

I am trying to create a budget sheet with a formula that essentially deducts an amount due from the total outstanding based on today's date and the dates each amount is due. So what I am trying to achieve is, for example, in the image link below. So for example, if I access the sheet on the 10th May, I would see the total amount due less the amounts due on 1st and 8th May as these dates have passed
If you want to include current date (i.e. the same date as today) as outstanding then use following formula:
=SUMIF(A2:A5,">="&TODAY(),B2:B5)
If you do not want to include then drop equal to symbol
=SUMIF(A2:A5,">"&TODAY(),B2:B5)

Finding and adding together overlaps in dates from 2 different columns in excel

I have 2 tables on my excel workbook. One to track tasks and one to track leave.
I want to see the impact leave would have on each tasks (i.e. the total number of leave days of a resource that would fall within the start and end dates of a task)
The table on the left contains the tasks. The table on the right contains the leaves.
What formula can I use in the column 'E' to obtain the total number of leave days that would fall within the start and end dates of a task corresponding to a particular resource?
Notes:
Working days are from Monday - Friday (leave impact from only
weekdays should be considered)
Holidays should not be considered in
the calculation.
Total leave will be inclusive of start and end
dates.
I'd appreciate greatly any help on this.
Thanks!
Apologies for late posting but this has taken a bit of thought. One way to do it is to generate an array of all the days in November, then test the array elements one at a time against each pair of leave dates to see if they fall within those dates, using countifs. So the basic formula is
=SUMPRODUCT(COUNTIFS($H$2:$H$7,$A2,$I$2:$I$7,"<="&ROW(INDIRECT($C2&":"&$D2)),$J$2:$J$7,">="&ROW(INDIRECT($C2&":"&$D2))))
However we want to ignore weekends, so to do this I set all weekend dates to zero before counting up the matches
=SUMPRODUCT(COUNTIFS($H$2:$H$7,$A2,$I$2:$I$7,"<="&ROW(INDIRECT($C2&":"&$D2))*(WEEKDAY(ROW(INDIRECT($C2&":"&$D2)),2)<=5),$J$2:$J$7,">="&ROW(INDIRECT($C2&":"&$D2))))
A fairly long formula but it seems to give the correct results.
Columns E, L and M are for checking only and are not part of the final result in column F.
I used this "array formula" in E2 confirmed with CTRL+SHIFT+ENTER and copied down
=SUM((H$2:H$7=A2)*TEXT(NETWORKDAYS(IF(I$2:I$7>C2,I$2:I$7,C2),IF(J$2:J$7<D2,J$2:J$7,D2)),"0;\0"))
This checks that the Resource matches, and for all matching rows does a NETWORKDAYS calculation (which ignores weekends) within any overlapping date periods between leaves and tasks.
Where there is no overlap a negative value is returned so TEXT function is used to convert the negatives to zeroes.
SUM function sums the resulting array to give you the required total - see screenshot
If you want to allow blanks in the "leaves" end date field then you can use this adjusted version which will assume end date is today
=SUM((H$2:H$7=A2)*TEXT(NETWORKDAYS(IF(I$2:I$7>C2,I$2:I$7,C2),IF(IF(J$2:J$7="",TODAY(),J$2:J$7)<D2,IF(J$2:J$7="",TODAY(),J$2:J$7),D2)),"0;\0"))
...or you can replace the two instances of TODAY() with another date or cell reference containing a date

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.

Take me to next pay period end date?

I'm trying to create a formula that will take me to the next pay period end date.
For example, if the employee's leave of absence is going to go unpaid effective 1-1-15, I want a formula that will tell me when the last day of the pay period is for 1-1-15. We have biweekly pay periods.
Step 1: define your pay periods.
In your case, it seems pay periods are simply every other week, always on the same day of the week. You may get away with simply writing a formula that checks to see if the target date rounds into a number divisible by 14; however in the case of a holiday (which may push the payment into the prior day or the following Monday depending on holdiay), I recommend creating a list manually.
To do this, go to a new sheet (let's say Sheet2). On A1, write the date of the last pay period which just happened. Then on A2 and drag down, use the formula:
=A1+14
However, after dragging this down to the end of the year, I recommend that you go back and manually confirm that each date is appropriate (ie: are there any special cases?
Step 2
Use a lookup formula to check which pay period a date falls into. Here I'll assume a simple case, where Sheet1 A1 contains the date that an employee begins unpaid leave, and Sheet1 B1 will contain the pay period which that date falls into:
=VLOOKUP(A1,'Sheet2'!A:A,1,1)
This will look for the value in A1 on Sheet2 - if it falls on the exact day, it will spit it back to you. If it doesn't fall on the exact day, it will give you the next closest date after that [make sure this rounds the way you want; I couldn't quite get a sense of the actual response you wanted].

Data validation for calculated cell

I'd like to make it so that an error is returned if a calculated cell attempts to go below zero. I have made a vacation day excel sheet so that if a person schedules a vacation day, the total amount of vacation days remaining decrease. The thing is, if I schedule for more days than I have available, the calculated cell for the remaining days will go into the negative values since it is calculated and not user entered. I used data validation on the cell and if I try to manually enter a negative number it wont allow me. I just want the same thing to happen for a calculated cell.
Data Validation is not appropriate for this task, instead use:
=IF(your_formula<0,"ERROR",your_formula)
If Column A is Total Vacation Days allowed, Column B is the Total Vacation Days Used, and Column C is the formula =A1-B1, then apply custom data validation to B1. The formula would be =B1<=A1. That should work. It's not applying it to the answer cell, but the input cell creating the error.

Resources