I have an Excel sheet with columns for the start and end dates of employees in a project. Like:
Name (Cell A1) Start Date(Cell B1) End Date(Cell C1)
John Doe (A2) 9/1/2015 (B2) 3/1/2016 (C2)
D Barret (A2) 8/1/2015 (B2) 2/1/2016 (C2)
D Barret (A2) 7/1/2015 (B2) 8/1/2015 (C2)
Based on these start and end dates, I want to count the number of resources in the next months:
Month (F1) #Employees (G1)
Jan 2016 2
Feb 2016 3
I want to autopopulate the #Employees column with numbers based on the start and end dates. So if there are three people who start/continue in February of 2016, then I will have those three minus the people who leave in January.
What would be the best way of achieving this in Excel?
See the formula in cell B9 below. I am a little confused on exactly what you are asking for. The below function will count the amount of employees that are currently working in January 2016. So essentially the Jan 2016 has to be between the employees start date and end date.
Related
I am creating a revenue recognition model that tells the user the specific months X amount of revenue falls into based on specific start date. For example, I have an invoice dated 1/1/17 for $1200 total in monthly services that will be incurred over the next 3 months ($400 per month)
I want to create the model so the user enters the invoice date "1/1/17", the invoice amount "1200", and the number of months the invoice amount is spread over. In this case "3".
The model is setup with 24 columns which have the MM/YYYY header in each column. "Jan 2017, Feb 2017..Dec 2018". As the user enters the date, amount and # months, the values per month "400" will populate in Jan, Feb, and March 2017. The remaining months will have zero or be blank because no revenue will be allocated in those months.
I don't want anyone to give me the answer here, but I don't even know if this is possible in excel without using VBA. Some insight in how to get started would be helpful. Thanks!
This could be a start:
B1, B2 and B3 are the input cells. B1 must be a date not a string.
D1 to O1 are the months. The values must be dates, not strings, but could then be formatted to show only month and year. Format MMM YYYY for example.
You need only inputting D1 and E1 as dates 2017-01-01 and 2017-02-01, then select D1:E1 and fill to right. Then a series will be created having from step to step the difference of E1 - D1, which is 1 month in this example.
Formula in D2 is
=IF(AND(D$1>=DATE(YEAR($B$1),MONTH($B$1),1),D$1<=DATE(YEAR($B$1),MONTH($B$1)+$B$3-1,1)),$B$2/$B$3,"XX")
and can be filled to right as needed. In the example up to O2.
Now if you are changing any of the input cells, the values in D2 to O2 will also changing due to the formula.
I have 2 columns in Excel sheet, Column1 has the Quarter Selection dropdown box(Q1, Q2, Q3 and Q4). And Column2 has the month selction dropdown box.
I need help in the below.
Q1 - Feb, March, April
Q2 - May, Jun, July
Q3 - Aug, Sep, Oct
Q4 - Nov, Dec, Jan
Now if a user selects Quarter as Q2 in Column1, the Dropdown values in Column2 has to have only May, June and July.
I tried the grouping option but it doesn't help me.
Thanks in Advance,
Satish D
You should create two tables, one containing quarters, and other containing all quarters with corresponding months (tables are surrounded with thick border).
Then in cell A2 create simple data validation and set list in D1:D4 as source.
In cell B1 also create data validation list, set allow to list, and in formula area please enter this formula =OFFSET(INDIRECT(ADDRESS(MATCH($A$1,E1:E12,0),5)),0,1,3,1)
You data validation list in cell B1 is now dependent on selection in list A1.
I can't find anything in the archives of answered questions that addressed this.
I'm pretty good with Excel but this is frustrating me.
I've been tasked with improving the tool that our office staff uses to track regular hours, OT hours, and various paid leave.
I have a great start on the whole thing but because the company pay periods are bimonthly (1st to 15th and 16th to EOM) I'm running into difficulty automatically calculating the OT hours to pay when the work week (for the OT) spans two pay periods.
I have a column that shows the day of the week (Monday = 2, Tuesday =3, etc.) and I was trying to figure out how to look at the Day column and calculate all instances of Day2-Day6 hours to get OT hours (if any-I have a formula for that)to pay in the current pay period. I need to look backwards at the beginning of a new pay period if the new pay period does not start on Monday.
The spreadsheet has the prior pay period as well as the current pay period laid out.
I would sure appreciate any advice.
Have a lovely day - Lynda
Here is the data:
DayofWeek; Date; StartTime; EndTime; Lunch; Hours#Work; FringeType; FringeHours; TotalPayHours; WeeklyOTHrs (these are the column headers)
5 Thursday, March 16, 2017 7:30 17:00 1 8.50 8.50
6 Friday, March 17, 2017 8:00 16:30 0.5 8.00 8.00 12.00
2 Monday, March 20, 2017 7:30 17:00 1 8.50 H 8 16.50
3 Tuesday, March 21, 2017 8:10 16:30 1 7.33 7.33
4 Wednesday, March 22, 2017 8:00 17:00 1 8.00 V 8 16.00
5 Thursday, March 23, 2017 8:00 17:30 0.5 9.00 9.00
6 Friday, March 24, 2017 7:40 17:00 1 8.33 8.33 1.17
I now have a formula in the OT cells:
=IF($B30=6,IF(SUM(G26:G30)>40,SUM(G26:G30)-40,""),"")
Here are two options that might be helpful, both use the SUMIFS function. The first option needs less code, but requires that the start and end dates of the respective period are defined in cells outside the data table.
Option 1.
If you're only interested in the total for each pay period, you could skip the OT column and instead calculate the total outside the data table. Here's an example with only 3 columns. In the screenshot, B5 contains the following formula:
=SUMIFS($C$12:$C$33,$A$12:$A$33,">="&$B$3,$A$12:$A$33,"<="&$B$4)
SUMIFS sums all values in column C if they are within the dates of the previous period as specified in cells B3 and B4.
Similarly, B9 contains a formula for the current period, as defined by cells B7 and B8:
=SUMIFS($C$12:$C$33,$A$12:$A$33,">="&$B$7,$A$12:$A$33,"<="&$B$8)
Option 2.
If you want to track accumulated OT hours in each period, you can keep the OT column and add a variation of the formula above. In this example I have included two extra columns to define the start and end of the period (this makes the formula prettier; if you don't want extra columns, these formulas can be incorporated into the formula in column D).
In this screenshot, D3 contains the following formula:
=SUMIFS($C$3:$C3,$A$3:$A3,">="&E3,$A$3:$A3,"<="&F3)
This is essentially the same formula as in option 1, but the range increases for each row, so that D4 contains:
=SUMIFS($C$3:$C4,$A$3:$A4,">="&E3,$A$3:$A4,"<="&F3)
Also, the start and end dates of the period are dynamic and contained in columns E and F. The formulas check if the current date is in the first or second half of the month, and adjust the start and end dates accordingly.
Start date (cell E3):
=IF(A3<=DATE(YEAR(A3),MONTH(A3),15),DATE(YEAR(A3),MONTH(A3),1),DATE(YEAR(A3),MONTH(A3),16))
End date (cell F3):
=IF(A3<=DATE(YEAR(A3),MONTH(A3),15),DATE(YEAR(A3),MONTH(A3),15),EOMONTH(A3,0))
Note: If you want to avoid extra columns, you can incorporate columns E and F into D, so that cell D3 would contain:
=SUMIFS($C$3:$C3,$A$3:$A3,">="&IF(A3<=DATE(YEAR(A3),MONTH(A3),15),DATE(YEAR(A3),MONTH(A3),1),DATE(YEAR(A3),MONTH(A3),16)),$A$3:$A3,"<="&IF(A3<=DATE(YEAR(A3),MONTH(A3),15),DATE(YEAR(A3),MONTH(A3),15),EOMONTH(A3,0)))
I have 2 sheets called sheet1 and the other sheet2.
Info found on sheet1
Using columns a-d
Date Product qty used actual qty used
1-jan-16 aaaa 102 50
8-jan-16 aaaa 102 150
Date = 1 jan + 8 day till dec 31
sheet2 info
using columns a-d
Month count average
Jan
Feb
Mar
The count columns uses the =count function works OK.
But the average gives an error.
This is what I'm trying to do is average out the actual column on sheet 1 using the month criteria on sheet2, so for the month Jan it looks at sheet1 and averages out the 4 week that have the month Jan found in it.
I get #DIV/0! error
=AVERAGEIFS('sheet1'!H157:H208,'sheet1'!B157:B208,">="&Sheet2!A4,'sheet1'!B157:B208,"<="&EOMONTH(Sheet2!A4,0))
If any info missing please feel free to ask.
Thanks
For some reason it doesn't AVERAGEIFS does not like cell referencing against date values (at least for multiple conditions).
Provided that the Months are entered as actual month values formatted as mmm (which I assume based on the formula you provided), this formula works (I tested it against your sample data (extrapolated)):
=AVERAGEIFS('sheet1'!H157:H208,'sheet1'!B157:B208,">="&Date(YEAR(A4),MONTH(A4),1),'sheet1'!B157:B208,"<"&DATE(YEAR(A4),MONTH(A4)+1,1))
I'm looking for a formula in excel that will give me a current 12 month table. For example this month is April. I want a formula that gives me 12 months back from April in the exact format as show in the table below. For next month it will be May, and 12 months back from may without having to adjust any dates.
Month
5/1/2015
6/1/2015
8/1/2015
9/1/2015
10/1/2015
11/1/2015
12/1/2015
1/1/2016
2/1/2016
3/1/2016
4/1/2016
Thank you
Try this and copy down 11 rows
=EDATE((TODAY()-DAY(TODAY())+1),ROW(A1)-12)
If you number the months in column b starting from b2 =0 to b13=11
And row 1 has headers
A2 formula =EOMONTH(today(),b2-1)+1
A3 formula = EOMONTH(today(),b3-1)+1
Etc.
EOMONTH will give you the last day of any month. So if we start with today() it will give you the last day of the current month, but if we count back 1 month (b2-1). It will give you the last day of last month. So we add 1 day to it and you get the first day of each month.
Hope this helps :)