Month-to-date totals - excel

I have an Excel workbook that has several different worksheets in it. The one worksheet that contains the main data has 100's of entries. This sheet also gets a new entry every day in the row column. The first column is the date column that is formatted as date and time.
I need a formula that checks the newest entry's date to see if its month matches the current month and then sums all entries for that month. I know that I am going to use a SUMIF but the hard part is the rest of the formula. I forgot to mention that I need the formula to divide by the number of current month entries used.

Assuming your dates are in A1:A26 and amounts to be summed are in in B1:B26 here is the formula to use.
=SUMIFS(B1:B26,A1:A26,">="&DATE(YEAR(TODAY()),MONTH(TODAY()),1),A1:A26,"<="&TODAY())
This returns the amounts that are in a date that is greater than or equal to the first day of the current month, AND less than or equal to TODAY.

There are a couple ways you could do this and I would suggest using sumproduct formula.
I'm assuming your data has dates in column A starting in row 2, and a value in column B.
In column C you could have a total in each line which is the sum of all rows above the current one that the month matches.
Formula in C2 would be below which can be carried down
=SUMPRODUCT(--(MONTH(A2)=MONTH($A$2:A2)),$B$2:B2)
Otherwise if you have a single cell and just want to get the latest total this formula would do it. This assumes the latest entry will also be the newest date (highest value)
=SUMPRODUCT(--(MONTH(MAX(A:A))=MONTH(A2:A1000)),B2:B1000)
In sumproduct the first part of the formula --(A=B) returns true or false values which equate to 1s and 0s. The second part is just your value columns.
The second formula does the same thing but it compares the month of the newest date to all others in the column.
Gordon

Since new entries are added daily I am assuming these are in date order ascending, so please try:
=SUMIF(A:A,">"&EOMONTH(TODAY(),-1),AD1:AD100)
or adjust the AD range to suit (could use AD:AD).

Related

how to count all the entries put under a row having specific days of a month

In this Sheet:
How to count all the entries (Text or Numbers) under A1 to AD1 (based on days only from Sun to Thu.) except Fri and Sat.
Note: if month is changed from list thus all the dates and days will be changed. Counting done as per changed month
Note: if month is changed from list thus all the dates and days will be changed. Counting done as per changed month
Given there are two rows at the top of the sheet, I am going to assume you want to check the contents of A3:AD3 against the day of the week in row A1:AD1
My simple answer is this formula at the end of each row (cell AF3, for example)
=COUNTIFS(A3:AD3,"=*",A1:AD1,"Sunday")+COUNTIFS(A3:AD3,">0",A1:AD1,"Sunday")+
COUNTIFS(A3:AD3,"=*",A1:AD1,"Monday")+COUNTIFS(A3:AD3,">0",A1:AD1,"Monday")+
...
You could also create a hidden helper row (let's call it AD2) that operates on the date row using the WEEKDAY() function, which will generate a number between 1 an 7 for the day of the week starting with Sunday. In this implementation, you would only need the following:
=COUNTIFS(A3:AD3,"=*",A2:AD2,"<6")+COUNTIFS(A3:AD3,">0",A2:AD2,"<6")
Another solution would be to copy/paste a similar formula across the columns at the top of the sheet (row1, for example), as follows:
=IF(WEEKDAY(A2)<6,COUNTIF(A3:A32768,"=*")+COUNTIF(A3:A32768,">0"),"")
This assumes your date is in row2 and the data entries start in row3. As rows are added to the sheet the formula will work without requiring any action. In this example I used 32768 for the max number of rows but this is arbitrary.
To get the overall total you would sum the across the columns of row1, such as SUM(1:1) or sum (A1:ZZ1) depending on the number of columns you have.

Increment Date by One Day in Formula - Excel

I want to have separate two columns that each row has a date, and another row containing total sale of the date.
I want my formula to increment the date by a day and automatically sum every transactions in that day.
I apologize if my explanation is awful.
Use Sumif To Sum Value See Bellow Mention Screenshot
=SUMIF(A:B,D2,B:B)

Change value, based on current month

I have the following tables
Here is the table I have (Picture 1). Similar tables would be generated for each month, but each month might have more or less rows compared to the previous. It all depends on the data that needs to be inserted. What is important is the cell named "TOTAL" for each month.
So, on a different sheet I have the Picture 2 table, where I need to populate the TOTAL of the month we are currently in. In this case I would need to have the November Total populated.
Picture 1: https://i.stack.imgur.com/2U3bX.png
Picture 2: https://i.stack.imgur.com/CHimY.png
How can I populate the values for "Total for the current month" automatically, based on the current month? Meaning that when the month changes, the value for that cell should change as well and should be populated from the current month's "TOTAL" cell.
Thank you all!
EDIT due to the refined question:
You need to use SUMIFS to sum the TOTAL where the related date matches the current month.
Assuming that your criteria is that you always calculate the month based on TODAY(), we can use TODAY() as well in the formula.
So if you have your Value cell in B2, paste this in:
=SUMIFS(I:I;H:H;">="&DATE(YEAR(TODAY());MONTH(TODAY());1);H:H;"<="&EOMONTH(TODAY();0))
where I:I is the TOTAL column and H:H is the dates column in your orders table.
The >= and <= indicates the range of dats between the first and last day of the CURRENT month (based on TODAY()).

How to make criteria in AVERAGEIFS update automatically?

I am trying to make my AVERAGEIFS criteria update automatically according to the day of the year (in this case only for 2014). My original AVERAGEIFS formula works perfect =AVERAGEIFS($B$2:$B$35041,$A$2:$A$35041,">=1/1/2014",$A$2:$A$35041,"<1/2/2014"), but I have to manually edit it for each day of the year.
I have tried modifying formulas I have seen in other posts here, but no luck so far. I want to average the values in column B (Amount) for each day in column A (Date). I have 96 time slots for each day of the year, hence the 96 entries in column A with the same date, e.g. 1/1/2014 and so on until 12/31/2014. How can I modify the formula so that it automatically adjusts the day when I drag it down?
Here is a screenshot of the data:
Screenshot of data
Any help is much appreciated!
EDIT: Updated formula below; I had misread the original question as to how your data was formatted. You can put this formula in B2 and copy down.
=AVERAGEIFS($B$2:$B$35041,$A$2:$A$35041,">="&$A2,$A$2:$A$35041,"<"&($A2+1))
Your original comparison operator hardcoded a date as a string. We can simply concatenate the value of a cell into that comparison string instead.
Granted, this will do the same calculation for each of the 96 entries for each of the days in your sheet. You could add a second sheet for the averages with just the distinct days of the year listed in A and an average calculation in B.
EDIT 2:
If your entries in column A have fractional date information (i.e. with hours, minutes, and seconds), converting the dates to integers will drop any fractional component:
=AVERAGEIFS($B$2:$B$35041,$A$2:$A$35041,">="&INT($A2),$A$2:$A$35041,"<"&INT($A2)+1)

How to sum data in a column corresponding to a start date to today's date

So, I am working on a loan payoff sheet and I wanted my excel sheet to be automatically updating.
One of my questions was answered when I searched how to select data corresponding to today's date using the function VLOOKUP(TODAY(),A:B,2,0) but that will only respond data in the column adjacent to today's date.
I would like to sum the data in the column of daily interest from the start date (provided) and have it automatically update for today's date. Attached is a snapshot of what I am trying to describe.
I currently have the dates stretched out several months in the future and am just summing the entire column of daily interest values.
If anyone knows how I can choose a start date of the first day and then automatically sum the values of the dates in between that would be fantastic.
Assuming Column A is your Date column and its the only numbers in the column you can use:
=MIN(A:A)
Having said that normally charts like this are built by a start date provided in a cell somewhere. If you can find that cell, simply link to it instead.
In order to get your sum of only appropriate dates, you will want to look at the formula SUMIFS. This will allow you to have multiple criteria that all have to be true. Assuming your interest is in column C you might be able to use the following formula:
=SUMIFS(C:C,A:A,">="&MIN(A:A),A:A,"<="&TODAY())
'Substitute your direct cell link for MIN(A:A) if you have it
Basically
=SUMIFS(Range to sum, range to check 1, criteria for check 1, range to check 2, criteria for check 2)
If for some reason you have data above and below your dates and interest column, you may need to adjust your ranges from A:A to A5:A678 where 5 is the first row of your data and 678 is the last row of your data.
With dates in column A and value in column B, place the start date in C1 and the formula:
=TODAY()
in C2. Then in another cell enter:
=SUMPRODUCT(--(A1:A9999<C2)*(A1:A9999>C1)*B1:B9999)
This formula give the sum of values between the date limits (not including).
The formula does not require the dates in column A to be in sorted order.

Resources