List yearly, monthly, quarterly, biweekly dates interval in a column through excel formula - excel

I have the table below.
In the first column, I placed the periods (or the number of instances; it works like an ID in this table). The table is named "LoanSchedule".
$B$20 stores a date. In this case, I entered February 20, 2020.
I have this formula in Column 2 to list the consecutive monthly date after $B$20.
$B$18 stores the number of times payment is made in a year
=IF(AND([#[Payment Period]]<>"",$B$20<>"--"),IF($B$18=12,EOMONTH($B$20,ROW([#[Payment Period]])-ROW(LoanSchedule[[#Headers],[Payment Period]])-1)+DAY($B$20),"--"))
It works well if payment is monthly or $B$18 = 12.
How can I modify the formula if Payment periods will be quarterly(4x year), yearly, or biweekly (26weeks), and list the corresponding months?
For example if I choose quarterly & $B$20 stays the same, the dates that will be displayed on the second column will be May 20, 2020; August 20, 2020, November 20, 2020, February 20, 2021, etc. if Biweekly, every 2 weeks. Thanks for any help.

You need to translate the entries in B18 (number of pmts per year), and the payment period, into the number of months or days to add to the original date.
I translated {1,4,12} using a lookup table with vlookup, handling 26 separately for the 14 day interval (2 weeks).
I chose this method because merely dividing 12/$B$18 would require a more complex formula should the result of the division not be an integer, since payments would then not be at monthly intervals
=IF($B$18=26,$B$20+14*[#[Payment Period]],
EDATE($B$20,VLOOKUP($B$18,{1,12;4,3;12,1},2,FALSE)*[#[Payment Period]]))
B18 = 12
B18=4
B18=26

Related

What function do I need for getting year-to-date % increase over prior year?

I have an excel workbook for multiple restaurants that has sheets for every year labeled with their sales per month. I am attaching an example of one row of the sheet for the year 2020. I would like to have a cell at the end of each row that shows the % increase or decrease over the prior year up to the last month entered. It would be pulling the information for the results from the prior sheet. I don't know which function to use or how to get the function to only add the corresponding months to date from last year. For example, on the sheet for 2020, sales are listed through July but the sheet for 2019 has all 12 months listed. I would like to include a cell that gives me the year-to-date % through whatever current month it is.
Sheet for Year 2020
If you want to use only the columns filled in the current year in the percentage calculation, you can use following formula:
=SUM(B3:M3)/SUMPRODUCT(B2:M2*(B3:M3>0))-1
First count how many cells are blank in your current year using the
=COUNTBLANK()
Then sum up the year you are comparing to starting at january then going 12 - result of blankcells formula to the right.
=SUM(OFFSET(JANUARY_CELL_REF, 0, 0, 1, 12-COUNTBLANK(this_year)))
Then you just divide it by the results this year so far:
=result_So_far_this_year / SUM(OFFSET(JANUARY_CELL_REF, 0, 0, 1, 12-COUNTBLANK(this_year)))
Finally format is as a percent.

Return last day per month (and week) in dataset

I have a large amount of daily stock market closing data that I need to report on, however I only need the last day of the month from each data set.
Given the dates of each month will differ year to year depending on weekends and public holidays I can't just use =EOMONTH(A2,0)
How do I extract, just the last day of each month from a data set probably using the MAX functionality in some way. Then I can just do a Vlookup to get the data for that date,
[![Share Price Sheet][1]][1]
If your date column is sorted by small to large, index() and match() could solve this problem.
Try to use:
=INDEX(A:A,MATCH(EOMONTH(DATE(D2,E2,1),0),A:A,1))
which point is set third argument to 1 in MATCH function.
If you want to get close price, in G2 cell write:
=VLOOKUP(F2,A:B,2,FALSE)
Since the last date is found on the dataset you have, you can just select distinct your year & month in a new sheet, create a helper column combining the 2 columns.
Create the same helper column in your original dataset, sort dates by newest to oldest. And you can vlookup the exact date. If you just want the day part of the date, extract the date from the Date itself with the day formula
You can do this just by Pivot Table
Select your data (I used a snipped only)
Insert a Pivot Table
Use Year, Date and Close as your Row labels
Use Date also as a value field
Set Date in your value field to show Max, format to actually show dates and rename if you want, e.g. "Last Day"
Click any date under any month in the row labels > Filter > Top-Ten > Choose to filter top 1 under Last Day and confirm.
Format your pivot table to your liking, maybe hiding subtotals.
My end result looks like:
You could use a combination of EOMONTH and WORKDAY.
For example:
The date you're looking at is 21st November 2019.
=EOMONTH(DATEVALUE("21 Nov 2019"),0)+1 will return 1st December 2019.
30th November is a Saturday, and for some reason the 25th to 29th November are holidays.
=WORKDAY(EOMONTH(DATEVALUE("21 Nov 2019"),0)+1,-1,{43798,43797,43796,43795,43794}) will return 22nd November as last working day of the month.
Using cell references (D3 = Date, A1:A5 are the holidays):
=WORKDAY(EOMONTH(D3,0)+1,-1,$A$1:$A$5)

Automatically change excel cell value depending on current Month

Stock analysis Dashboard. I need to compare the stock from today vs the previous 6 months.
My stock data
Cell A1:R1 - month data example Cell A1= June 2017, B1= 7/2017 ....till R1= December 2018.
Cell A2:R2 Stock numbers data example A2=23, B2=25,........till R2=50.
IF I want to see the stock today month which is July 2018= M1 vs six months February 2018 H2 and the stock level calculation will which is M2=26 - H2= 30 =-4.
But instead of entering formula every time I need to be updated every month based on the today month?
Any tips on how to do it?
Thanks
I also miss a date...
If you use today() function to identify today's date you can use:
=HLOOKUP(TODAY(),$A$1:$S$2,2)-HLOOKUP(DATE(YEAR(TODAY()),MONTH(TODAY())-5,1),$A$1:$S$2,2)
If you need a cell with a specific date, replace today() formula with that cell.
I find the question a bit confusing. If A1 is June 2017, I am missing a month if R1 is December 2018 and July 2017 is in M1. Also, even though you said 6 months, I am assuming that you want 5 months so that July compares to February.
This response assumes that A1 is wrong but R1 and M1 (and B1 through R1 are accurate) and that the values in A1 through R1 are actually an Excel date that is formatted as m/yyyy (as opposed to some text representation of a date).
This formula is further complicated since I do not know what day is used in the date representation in A1 through R1, hence I am adapting both that date and the current date to be a fixed day of the month (I chose the first day of the month in my formula).
Here is the formula that computes the -4 assuming M1 is 7/2018, M2 is 26, H1 is 2/2018, H2 is 30 and we want to compare column M to column H since today is in July and we want to compare July to February (5 months difference):
=INDIRECT("R2C"&MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0),FALSE)-INDIRECT("R2C"&MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)-5,FALSE)
This is an array function so it needs to be entered with [Ctrl]+[Shift]+[Enter].
The way it works is that it computes from today's date, the date value equal to the first day of this month. Then it compares that against the range A1:R1 with each of those dates likewise moved to the first of the month. This gives us the column to use for "this month" and using the same computation but subtracting 5 gives us the column to use for "six months ago." Out of sheer laziness I used these values in an indirect cell reference to pull the Row 2 values for "this month" and "six months ago" and subtracted the latter from the former (i.e., "this month" - "six months ago").
In other words, this part of the formula gives me the column of the current month:
MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)
and this part gives me the column of the month six months ago (as defined in the original post):
MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)-5
As I indicated, this may not be what you wanted, but this is what I thought you were asking.
Alternate version using INDEX function
=INDEX(A2:R2,MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0))-INDEX(A2:R2,MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),DATE(YEAR(A1:R1),MONTH(A1:R1),1),0)-5)
The above would also be entered as an array formula.

Calculating Based on an Array in Excel

I have a Pivot Table that I am able to cycle through the different months based on a Month Filter (changing the data of the table). I am trying to calculate based off of that change of value. I am recording the amount of times a license is used in a workday. The number of workdays in a month change based on the month. I calculated out the workdays for each month using
=NETWORKDAYS(H34,EOMONTH(H34,0),J34:J45)
H34 references my 1/1/2016 date. J34:J45 references my holiday dates to avoid.
I am trying to write a formula that says "If the month listed (from my month filter) within the Months list then to print the corresponding Workdays value.
=IF(G34:G46=H48, I34:I46)
It only works on January. The rest of the values return False. I do calculate it as an Array Function. It returns either False. I cannot think of another function that could replace it. Any help would be appreciated.
2016
Month Date Workdays Holiday Dates Holidays
January 1/1/2016 19 1/1/2016 New Year's day
February 2/1/2016 20 18-Jan Holiday 2
March 3/1/2016 22 2/15/2016 Valentines day
April 4/1/2016 21 3/25/2016 St. Patrick's Day
May 5/1/2016 21 5/30/2016 Memorial Day
June 6/1/2016 22 7/4/2016 Independence Day
July 7/1/2016 21 9/5/2016 Labor Day
August 8/1/2016 23 10/10/2016 Holiday
September 9/1/2016 22 11/8/2016 Columbus Day
October 10/1/2016 21 11/11/2016 Veteran's Day
November 11/1/2016 21 11/24/2016 Thanksgiving
December 12/1/2016 21 12/26/2016 Christmas
All 235
Selected Month
March FALSE
The VLOOKUP() function will greatly simplify this process for you. This particular function is great for extracting values in a list based on a key lookup field.
In your example, you want to easily extract the value from Holiday Dates column based on an input month.
A few things to keep in mind for the input parameter functions in this function:
The first column in your table array must contain the lookup value, in this case, the month column.
If may need to lock your array dimensions, use the $ sign in front of the column letter and row number.
FALSE should be selected for the range_lookup in order to do exact matching for the lookup value. If you choose false, you may get false positivies.
Every row in your list should be unique for the lookup value. Let's say January was listed twice, the value returned would be for the first occurrence.
Additional info:
http://spreadsheeto.com/vlookup/
http://www.howtogeek.com/howto/13780/using-vlookup-in-excel/
You can use the LOOKUP function, as follow:
=VLOOKUP(G48,G34:I45,3)
This formula looks up "G48" value in column G (first matrix column), and returns the value from column I (third matrix column) that is in the same row.
Read this official Office page for more details.
Please, give us your feedback.

Google Spreadsheet: Find the largest number within a date range

I have three columns. One has a date, one a numerical value, and the last a text value. I want to call from a different sheet the nth largest number within the last month, and then in the cell beside it, the text value corresponding with that row. The column headers are named ranges for ease, and titled Amount, Date and Name.
Amount Date Name
------ ----------- --------
5 11/11/2013 Fred
30 5/11/2013 Bob
5.2 23/11/2013 Jack
40 29/10/2013 Tim
If I wanted to just get biggest number, I could do "=Large(Amount;1)" which would return 40, but I'm looking to get the largest amount in the last month (not just the last 30 days) which should return 30.
What I'm currently doing to pull the name (which will give name next to the largest value, not the largest value in the last month) is "=INDEX(Name,MATCH(Large(Amount;1),Amount,0))"
All of this is being done in Google Drive on their spreadsheet.
Thanks!
You can use the filter function, like this:
=LARGE(FILTER(A:A, YEAR(B:B) = 2013, MONTH(B:B) = 11), 1)
This means: get the max value from column A filtered based on the B column, where year is 2013 and month is 11.
zord's answer looks good for November 2013 but I think you want the "last month" so on December 15th assuming you want any date after November 15th then you can use a similar approach but use EDATE function to get a date one month back from today, i.e.
=LARGE(FILTER(A:A,B:B>EDATE(TODAY(),-1)),1)

Resources