Create multiple Excel rows from Date Frequency? - excel

My Spreadsheet contains rows of financial transactions. Each row contains a cell called Frequency. Currently it's a text field designating if the transaction is monthly, semi-annually, quarterly or annually.
For example, row 1 is a 5,000 withdrawal taking place on the 10TH OF Jan,Apr,Jul, Oct.
Is there any function which could automatically turn the 1 row into 4 separate rows denoting each quarterly date?
The frequency field could be in any format needed to accomplish this. The ultimate goal is a spreadsheet sorted by date that would show all transactions for the year. Thanks.

You might search through Excel functions (alphabetical) but there are hundreds so it could take, and waste, a lot of time because there is no such function.
The result you seek should be relatively easy with VBA or similar.

Related

How to use Excel to automatically add interest to a total daily

I can't find my answer anywhere, but believe it's a simple solution. I need Excel to automatically calculate the daily interest on an amount (which will go up and down with deposits and withdrawals), and then add it to the total, to display the overall total including interest (compounding). This will change daily when someone looks at the value in Excel due to the daily interest being added.
For example. I have $5000. At 5% APR, the daily interest rate would be .0137%. The day after the $5000 is there, the new total should show $5000.68 if I opened and looked at the spreadsheet. If didn't check the spreadsheet, then on day 2, the total should show $5001.37. If I added $5000 more to the total on day 2 (after interest was added) I would then have $10001.37 and the interest rate for the next day should automatically add on to the new total, compounding daily.
Sample spreadsheet with today as 12/10/22, needing to have total balance update daily
Essentially, I want a spreadsheet that can display the overall balance in an account which compounds daily, allowing withdrawals and deposits at anytime [H2]. How do I accomplish this!?
If you have interest starting date then could use below formula-
=(B2*0.0137%)*(TODAY()-A1)
Here A1 cell is interest starting date.
To see total with interest can use-
=B2+(B2*0.0137%)*(TODAY()-A1)
Make a named value called DailyInterest with a value of 1.000137.
Then make a table like this...
Date
Change
Amount
5/5/2022
$5,000.00
0
Then highlight it and click Insert Table from the ribbon.
Tables will give you a few benefits, some cosmetic, but the one I want to show you is that you can define a formula for a column, and it's ONE formula. It doesn't get copied down to each row, it just seems that way, but the reality is that the formula stored once, internally, and applied to every row.
So, then, change that amount of 0 with
=IFERROR(OFFSET([#Amount],-1,0)*POWER(DailyInterest,[#DATE]-OFFSET([#Date],-1,0),0)+N([#Change])
Within the table, [#Date] refers to the value in the Date column for that row.
I used N() so that nonvalues in the Change column are treated as zeroes.
Now, each time you fill in the Date and Change column, the Amount column will be automatically populated.

Excel - Take Average of Monthly Data

I have a historical data set for commodity pricing. Throughout the data set, the data starts inputting prices on specific days, rather than the average of the entire month. In order to keep the flow of having only the average pricing for the months.
In the best case scenario, I would use an Averageif function, however, the data for each month doesn't display a consistent amount of days.
How can I automate this the process: If the month is the same as the previous row and different than the next row, calculate the average of the ^ rows until you hit the next month.
Here's a simple display of what I mean:
]1
You can use a pivot table to get the output you want. It will also be neatly organized instead of having your averages mixed in with a mostly blank column. Photo below shows the set-up/output of a pivot table generated with random data.
For a solution without pivot tables, you can use the following formula :
=AVERAGEIFS($B$1:$B$30;$A$1:$A$30;">="&(A1-DAY(A1)+1);$A$1:$A$30;"<="&EOMONTH(A1;0))
The above example is from cell C1, and can be copied down the entire list. The dates are in $A$1:$A$30 and the values in $B$1:$B$30. The first conditions test on the first day of the month (calculated as A1-DAY(A1)+1),and the second condition as last day of the month (calculated as EOMONTH(A1;0)
This will obviously put the average value of the month on each row, but will also work if your data is not sorted on date. If this is the case, and you only want to display one number per month in the column (as in your own example), you can add an additional IF statement wrapped around the formula:
=IF(EOMONTH(A2;0)=EOMONTH(A1;0);"";AVERAGEIFS($B$1:$B$30;$A$1:$A$30;">="&(A1-DAY(A1)+1);$A$1:$A$30;"<="&EOMONTH(A1;0)))
So it will display empty in all cells, except where the month changes.

Sum Variable-Length Week's Expenses

I'm trying to make an excel spreadsheet for someone else without much Excel experience. It's a relatively basic expense spreadsheet, with rows being a given date's expenses, and columns being the types of expenses and their amounts. I'd like to automate as much as possible with formulas or VBA.
Here is an example:
I understand how to sum up all expenditures in the table, but I'd also like to break them down on a week-by-week basis. The table will probably be added to rather infrequently, so there will be missing days. I'm not sure how to sum the weekly totals when there may be any number of entries for a given week.
For the example above, I'd like to have a column somewhere on the spreadsheet that has Week 1's sum (1/4/2015 and 1/5/2015) as one entry, and Week 2's sum (1/14/2015 and 1/16/2015) as a second entry.
Is this possible to automate with a formula or script?
I'd use a pivottable ("Insert" ribbon, "PivotTable" button on left)

Pivot table cannot find difference between January current year to December of previous year. Excel 2010

I am weeks into making my first ever pivot tables, cant believe the power of them but have hit a snag I cannot overcome.
I have a worksheet which has a column with raw data (manually imputed)
Then I have another 2 columns that calculate the difference from the previous month and the % difference. This works fine.
As you can see January 2015 is blank as the difference field is looking for the previous month and January is the first month.
how can I get it to understand to look at December 2014
When there are two different levels of grouping, i.e. Year and Month, it is not possible to get Excel to compare the last item of one group with the first item of the previous group.
Excel treats the additional level of grouping as a different field, which is visible when looking at the PivotTable fields. The Years of the Date show as a separate field:
When choosing to calculate the difference, Excel can only compare to values within the same field. Note that you can compare to a specific month value, but not a specific month of a specific year:
Similarly, Excel can't compare to values from the previous grouping, even though human-logic knows it's the previous value in the overall sequence.
To see the difference between each month across years, it's necessary to have all Year-Months in a single field. This isn't possible using PivotTable grouping on normal dates.
The workaround requires a new field to be added to the data which contains a single value per Year-Month. The PivotTable will then naturally group the data by these Year-Month values.
There are two ways this can be achieved:
Calculate the first day of each Year-Month
Insert another column with this formula (referring to a date in the A2 cell):
=Date(Year(A2),Month(A2),1)
This performs the grouping before the data goes into the PivotTable by treating every date as the first of the month. In the PivotTable, the full date will appear by default. You can apply Custom Number Formatting to the field to display only the Month and Year, for example: "mmm yyyy"
This is a better solution when grouping by months as it allows more formatting options.
Calculate a text value for each Year-Month
Insert a column with this formula:
=TEXT(A2,"yyyy mm")
For example, the following data:
Can generate this PivotTable (with sums and then differences):
The text solution has the drawback that you must specify the Year and then Month numerically (and padded to 4 and 2 digits respectively) if you want the PivotTable to automatically order the values in chronological order.
The benefit of the text solution is greater flexibility. For example, you could group bi-monthly with more advanced formulas or group two fields of actual data together by concatenation.
Have you tried combining the month and year in one cell? So on the source data, in the month column have:
Aug-14
Sep-14
Oct-14
Nov-14
Dec-14
Jan-15
Instead of having one column for month name and one for year.
Make sure that once you input the months in your raw data tab, they go to the right side of the cell meaning that Excel sees them as dates not text.

Generate trend graph in excel

I encountered a practical problem that can be simplified as follows:
My excel sheet has a single column which is the date I had a beer can. It can repeat based on the number of beers cans I had a day. (eg. I had three beers on 5/9/2012) I need to generate the trend of my beer consumption per week. How can I do it in excel?
**Date of beer**
5/9/2012
5/9/2012
5/9/2012
5/12/2012
...
7/3/2012
You could make a pivot table. Date as a row field, Count of Date (i.e., count of beers) as a data field. Group the row field Date by 7 days to get weekly totals.
You'd probably be better off with a two column spreadsheet. Column A = Date; Column B = Number of cans. Then you could easily just make a line graph from that.
If you already have a large amount of data in your format you can use excel's subtotal function to create the two column format for you.
First i would put a formula in to get a week number for each date, and then use a count if for each week of the year.
This formula will assign each day of the year the week number of the year it falls in. Put this in each cell next to your dates.
=IFERROR(1+INT((AF12-DATE(YEAR(AF12+4-WEEKDAY(AF12+6)),1,5)+WEEKDAY(DATE(YEAR(AF12+4-WEEKDAY(AF12+6)),1,3)))/7),0)
Once that is done create a column of numbers 1-52 (53 for leap year) and do
=countif(rangeofcalcdweeknumbers,week1to52)
and copy that down for all 52 or 53 weeks
Then make a graph based on the final two columns

Resources