Trying to create an invoice to auto populate. Have done this in VBA previously, but now the sheet is going on the cloud, and being used by Excel online so, VBA is out, unfortunately!
Trying to make a membership fee reappear every 12 months based on their start date!
I was trying around with EDATE, and got it to work on my test subject, but then realized it wouldn't work as I'm only going off the first 12 months!
Need a fresh set of eyes to give me ideas, or walk me through a simple solution (if possible)
Currently have the following, which works for the first year, then it won't!
Cell X7 = =EDATE(TODAY(),3) <----- Creates the cut off for invoicing if Membership due before then.
Cell V12 = =VLOOKUP(O12,'Youth Details'!$A$4:$H$95,8,0) <---- Returns their start date. i.e 19-Nov-2020
Cell W12 = =IF(AND(V12>TODAY(),V12<X7),"True", "False") <---- Returns if they have been with us for 9 months to 12 months and needs to be invoiced!
That works, for their first year, then the following year it won't invoice them as they've been there for 24 months.
I was thinking about expanding my VLOOKUP in cell V12, that if there membership was over 12 months ago, to add 12 to it, but got confused!
Any suggestions on where to go from here?
One way to do it might be
Figure the number of months they've been a member, like say 34.
Use the MOD() modulus function with a divisor of 12 (months). This will discard the number of whole 12-month-periods (years) they've been a member and leave you with just the number of months since their last anniversary. So for 34, it'd give "10" months since their 2-year anniversary.
If the answer from #2 says they're getting close to renewal, like they're 9+ months in to their current membership year, invoice them.
Cell V12: =VLOOKUP(O12,'Youth Details'!$A$4:$H$95,8,0) <---- Returns their start date, like 1-Jan-2019
Cell V13: =DATEDIF(V12, TODAY(), "M") <---- Total # of months they've been a member, like 34
Cell W12: =IF(MOD(V13, 12) >= 9, "True", "False") <---- Returns if it's been 9+ months since their last anniversary and they need to be invoiced!
Of course, if you allow people to prepay, then like AakashM points out it's worth making sure you're not invoicing them for something they've already paid.
Related
This is a bit of a complicated question for excel, so I'll try to explain as best I can.
I'm trying to track membership time for each member in a group in the member list which is an excel sheet. Currently I have 2 columns, one for years and one for months which are both calculating the proper time based on the Join date of the members. My issue comes when trying to calculate for the subsection of members who have 'broken' membership time, meaning they left the group and rejoined some time later. To correct for that I have a second sheet that tracks the previous time for those members (also in columns of years and months) and I'm trying to add it to the first sheet. The formulas I have are below:
-To calculate the number of years since the member joined, then add any previous years from the PrevTime sheet, matching on column B which is Name on my primary sheet:
=DATEDIF(F2,TODAY(),"y") + INDEX(PrevTime!A:C, MATCH(B2,PrevTime!A:A,0), 2)
-To calculate the number of months since the member joined, then add any previous months from the PrevTime sheet, matching on column B which is Name on my primary sheet.
=DATEDIF(F2,TODAY(),"ym") + INDEX(PrevTime!A:C, MATCH(B2,PrevTime!A:A,0), 3)
Now, everything works fine with both these formulas, the issue comes when the member in question has some combination of current membership time months, and previous membership months that exceed 12. Then I end up with one less year for their membership time and more than 12 months for their membership months. (i.e. 2 years, 15 Months instead of 3 years, 3 months).
Was just hoping someone here might have an idea or any insight into things I could try to sort this out so the times are displayed nicely without overflowing the months past 12.
Thanks in advance
I'm using the new STOCKHISTORY function in Excel and I'd like to always display the past 17 trading days from the point I indicate. The problem is with long weekends and holidays this alters the amount of business between two dates. I'm not sure if this will be a difficult question because I think the solution is not dependent on the fact that I'm using the STOCKHISTORY function. I have attached a photo with a simple explanation. On the left the formula for STOCKHISTORY is =STOCKHISTORY(E2,C4-C6,C4,0,1,0,2). This displays 17 business days because 22 is the magic number. On the right though if I query July 22nd with 22 day difference I only get 16 days. This is further wrong on many other dates.
I am open to having a separate reference on another sheet that has dates/formulas. I tried this but couldn't figure out a formula to pull down. Photo B displays an example of the correct number of dates that would show 17 trading days. I am also open to displaying more than 17 trading days as in the future I will need to alter the amount of trading days needed (I might need to display 15 days or 20 days).
In my head I feel like the answer has something to do with the NETWORKDAYS function and/or I should make a list of all the trading days in a year and then make a formula taking the current day and taking away a specific day. Or I could be totally wrong and the answer is obvious.
So I figured out an answer after reading some documentation. There is most likely better answers but it solves the problem enough.
So I created a list of all trading days (business days) as you can see in column O. Then in Column L a list of nearby holidays (Only needed a few exceptions). Then using the formula =(O35)-(WORKDAY(O36,-17,$L$35:$L$36)) I get the right solution which I verified in my example photo posted earlier. You could theoretically get a different number when doing your own calculations (i.e the answer 24 and 23 are both correct).
I'm trying to figure out a way to create an excel spreadsheet that will allow me to keep track of how many hours I've earned per each paid holiday my company offers, then keep track of how many hours I've used and what's remaining. But I'm unsure how to calculate this properly.
I could easily do the math my self as it's a simple lay out, but I'm trying to find a way that will just let me enter the numbers for earned and used and walk away from anything else.
What I'm trying to do is the follow:
Have multiple sections. In the first section it'll be my holidays. So in like Column A, working down I'd have New Years, Memorial Day, July 4th, etc. Column B working down would be time earned. But this would be labeled in each cell as "8 Hrs" or "4 hrs". Column C would be time used in the same format "4 hrs" "8 hrs". Then Column D would simple be hours remaining.
Now in the second section I'd have holiday hours earned, which is 2 weeks. Not too sure how to lay it out, and then I still have my sick days, but not sure if I should include that in section 2 or not with the vacation time.
I'd like a way to be able to simply Calculate B2 - C2 = D2. So 8 Hrs - 4 Hrs = 4 Hrs (to show 4 Hrs remaining for each line item.)
Problem is I'm unsure how to calculate remaining time simply because of the Hrs suffix. And with that I also can't calculate total time still remaining, both for holiday hours earn and vacation/sick hours.
Yes, it's easier for me to track it as 8 Hrs rather than 1 day, etc.
Any advice on how to formulate this. Or if anyone knows of a premade template that fits this type of scenario, that I could then just take and integrate into my own spreadsheet.
Sorry if this is confusing in any way.
Also, As I'm no excel wizard, unsure if this is relevant or not, but I'm using Excel 2016, as part of the Office suite.
Another option is to just leave the number as it is and label the column accordingly. Do you really need to see "hrs" in every cell when you know you are tracking hours?
Use a custom number format of,
[>1]0 \H\r\s;[=1]0 \H\r_);0 \H\r\s;[Red]#
... and treat all hours as integers.
I have a sheet that I use to calculate my taxes, deductions, and 401k based on a timesheet. It also calculates my PTO, sick, and comp days (I don't get overtime, when I work overtime I get that time back at the end of the year as extra paid days off). My issue is that with the timesheet, it's tough to calculate my sick days, all other times are hour for hour or based on the pay period. But with sick days I get a specific amount every year.
Basically, I get 10 days (80 hours) per year. So I take that 80 hours, divide it by 26, and that gives me how much sick time I get per pay period. Problem is, since I get a biweekly pay, that's not actually correct. So for example, this month I have 2 paychecks, I'd get .92 days of sick time, but I should actually get 1. On the 2 months out of the year where I have 3 paychecks I would get 1.38 days of sick time, which of course isn't correct either.
So the issue is I'm trying to figure out how to write a formula to give me the the correct number of days. Refer to the screenshot:
So basiclaly on G6, the formula takes the rolled over sick days from the previous year (G39) and adds the current sick time to it. It decides that by checking if the gross pay for that pay period is there, then multiplies that amount by the sick time accrual rate (G40) and divides that by 8 to give me the days.
But what I want to do is to check how many months have been filled out and return that. So in this example May has been completed, so it would return 1 day. Since September has 3 pay periods, you will need to have all three September paychecks filled out for it to increment from 4 to 5 (may, jun, jul, aug makes 4).
Any ideas? Everything I've tried to do this it just fails. Keep in mind that those dates are dynamic, next year when I change the start date for the tax year, the months that have 3 months will change to match the actual pay periods for that year. So this formula will need to actually be able to count that any month has 3 pay periods to advance the sick day count, otherwise to do it if there are only 2 that have been filled.
Attempt #2 to answer! >8(
The end equation to do this all in one cell is going to get ugly,but it will work. In order to explain this and basically how I developed it, I am going to break it down into parts. At the end the parts will be back substituted into the big equation.
The first thing I did was determine what row was last filled, or as per the comments what is the last row of column P that has a value greater than 0. In order to determine this I used the aggregate function in a temporary cell of T15 (yes, in the middle of your spreadsheet but it wont matter in the end):
=AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)
To break this function down:
14 tells it we want to do an array type calculation sorting the array from largest to smallest.
6 tells it to ignore errors
(P5:P30>0) tells it to build a true (or 1) and false (or 0) array of cells greater than 0
(ROW(P5:P30)-ROW(P5)+1) generates an array listing row numbers
1 tells it to return the largest value in the array, if it was 2 the second largest.
Now the important thing here is what happens when you multiply the greater than 0 array with the row number array. You wind up getting only the row numbers where there is a value in P greater than 0. And when we sort that and ask for the largest number we get the last row you have completed. Something to work with.
So now we can look up the last date completed, do some checks to see if its the end of the month or not and figure out how many sick days. The ugly formula starts out as:
=IF(MONTH(INDEX(I5:I30,T15))=MONTH(INDEX(I5:I30,T15)+14),MONTH(INDEX(I5:I30,T15))-1,MONTH(INDEX(I5:I30,T15)))
The logic test here is to find our if the last filled out date and the date 14 days in the future are still the same month. If they are the same month, you are not at the end of the month yet and there for have only earn up to the previous month's number in sick days. As such this part will tell us the previous month's number os sick days:
MONTH(INDEX(I5:I30,T15))-1
Now if the date 14 days in the future is not the same month then we know the last entry for the month has been completed and therefore we have accrued that month's number in sick days and use basically the same formula:
MONTH(INDEX(I5:I30,T15))-1
well I can see we have called on cell T15 4 times just to determine if we are subtracting 1 or 0. While the IF formula may feel more inline with your thought process, we can rearrange things and still get the same results but shortening the formula, reducing the calls to cell t15 by 1 and dropping the IF all together. This only works because we are dealing with 1 and 0 which is also true and false.
=MONTH(INDEX(I5:I30,T15))-(MONTH(INDEX(I5:I30,T15))=MONTH(INDEX(I5:I30,T15)+14))
Now lets bypass that T15 calculation and back substitute it in to the month formula above to get:
=MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)))-(MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)))=MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1))+14))
Not done yet. That only tells you the number of days you have accrued this year. Not what you really want to know. you need to convert it to hours. It also need to be reduced by the number of sick days used. The following need to be added to the big ugly above:
*8 for 8 sick hours to a sick day
-sum($L$5:$L$30) to account for sick time used
this results in:
=(MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)))-(MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)))=MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1))+14)))*8-sum($L$5:$L$30)
Now I did notice during testing that if no entries are in the spreadsheet, then the row of the last entry become 0 and this is simply not acceptable as it causes some strange results. So we will wrap this whole formula in a small error catcher to make sure 0 is the results when no payperiods have been completed.
=if(sum(P5:P30)=0,0,(MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)))-(MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1)))=MONTH(INDEX(I5:I30,AGGREGATE(14,6,(P5:P30>0)*(ROW(P5:P30)-ROW(P5)+1),1))+14)))*8-sum($L$5:$L$30))
The icing on the cake is adding on the accrued sick days from the previous year. Since I am not sure how the sick rate and sick start work together I will leave that calculation up to you and simply let you know that whatever number gets carried over from the previous year, simply add it to the above formula after the very last ).
Here is my test bed showing proof of concept:
WARNING: This method ##WILL## produce false results for a pay period is =0 before the last date with a pay period >0 see example below:
I am trying to write a function in excel (without using vba/macros if possible), to count the number of remaining work days for each employee for the month, from the first of the month to a date I enter into A1. The problem is, the scheduling file I use starts on a Monday every time, so if the month begins on a Friday, there are 4 days from the previous month on the page and the same could happen at the end of the month if the month doesn't end exactly on a Saturday.
In row 6, I have the dates (formatted as 28-Sep-2015), and from rows 9 and below, I have employee names and whether or not they're scheduled to work on the days directly above in row 6. I'm looking to count the number of times the word "WORKING" appears in the row for each given employee, but only to count it if the header in row 6 contains "Sep". I don't want to count any times "WORKING" appears if it comes from the past month or the upcoming month. (Also, no one works Sundays, so Sundays are skipped.)
I'll try to show an example of set up here.. hopefully it can help:
A1: 28-Sep-2015
A6-H6: Employee, 28-Sep-2015, 29-Sep-2015,30-Sep-2015, 1-Oct-2016, 2-Oct-2016, 3-Oct-2016
A9-H9: George, WORKING, OFF, WORKING, WORKING, WORKING, WORKING
So for this small example, the result should only be 2 working days, since George only works twice from 28 Sep to the end of the month.
I've been searching for how to do this for a few days now, but nothing seems to work when I try it. Please help!
If you are using 2007 and later than use this:
=COUNTIFS($A$6:$G$6,"<="&EOMONTH($A$1,0),$A$6:$G$6,">="&DATE(YEAR($A$1),MONTH($A$1),1),$A9:$G9,"=WORKING")