SUM a range of rows by looking up by a separate column - excel

I have a spreadsheet. It has a timestamp in Column A and a dollar value in Column C.
I have another sheet that provides calculated values of the whole sheet, but I am also trying to provide a way for a user to type in a date as the start date cutoff. "Give me the number of entries since 10/1/2012" and "Give me the sum of all dollar values since 10/1/2012".
The count was easy, using a COUNTIF, however, I'm struggling to come up with the formula to give the dollar sum, based on the date cutoff. Since Date is in column A and dollars in column C.
Thanks!

Try SUMIF
=SUMIF(A:A,">="&D2,C:C)
where cutoff date is in D2

Related

sum of array results for 1st, 2nd, 3rd

Trying to figure out how to use an array formula to index a transaction list and sum the found numbers within a set date range.
I.e. meal card was used 15 times this month. Need those amounts summed.
I was thinking of an existing formula that searches for the first amount given a certain text match, if only the dates are within A1 and B1 (i.e. 7/1/18, 7/31/18). Next cell searches for the 2nd occurrence, etc.
=IFERROR(INDEX([Transactions.xlsx]Transactions!$D$2:$D$9000,SMALL(IF(([Transactions.xlsx]Transactions!$B$2:$B$9000="GREAT LAKES STUDENT LN ***********0000")+([Transactions.xlsx]Transactions!$A$2:$A$9000>=$A$1)+([Transactions.xlsx]Transactions!$A$2:$A$9000<=$A$2)=3,ROW([Transactions.xlsx]Transactions!$B$2:$B$9000)-ROW(INDEX([Transactions.xlsx]Transactions!$B$2:$B$9000,1,1))+1),1)),"None")
Wasn't sure if this formula could be used for a sum function or if it's a whole different setup.
Just as the formula references, transaction file dates are in column A, description in B, and amount in D
Thank you

How can I select a specific cell value filtering with the nearest date (in a column) to select a specific row?

I am very new in Excel and I have to implement this pretty complex task (at least for me it is complex).
I put what I am doing here: https://drive.google.com/open?id=1sWHbyl-Y-GgSiX7JJ3bJ9_y8DUts-E0e
I will try to explain exactly what I have to do:
For each rows I have to "calculate" the value of the L column in this way.
Each cell into the L column is "calculated" using the following steps:
Considers the date into the H column of this row.
Search the nearest date in the past into the A column to select a specific row.
Take the E column value of this row and use it to populate the current L cell.
So doing a practical example, I want to populate the L3 cell, I have to do:
Considers the date into the H column of this row: so I obtain the value of the H3 row that is this date: 16/12/2017.
Then, into the whole A column I search the nearest date in the past in this column (in this case it is 15/12/2017), so I select the row number 4.
Take the value of E4 cell value (598,05 €) and write it into my L3 cell.
How can I do something like this?
Thank you
This is a simple INDEX(...,MATCH()) situation.
=INDEX(E:E,MATCH(H3,A:A,1))
This will return the value in column E such that the date in column A is the greatest date less than or equal to the value in H3.
Note: This assumes the dates in column A are sorted in ascending order.
VLOOKUP:
=VLOOKUP(H3,A:E,5,TRUE)
This requires the dates in Column A to be sorted.

Average of sum of column values

I have a table with 2 columns : dates (1st of the month) and values. Each date can appear an unknown number of time. I am trying to find a formula that would make a yearly average of the sum of the value for each month.
I can easily make several sumproducts to have the sum of values for each month and then average but I would prefer to limit the size of the formula.
Does anyone has an idea on how to do that, or if that's even possible?
I assume that dates are in A column and values in B column.
The easiest way would be:
1) In third column (C), store the integers indicating the month. You will get this result by simple =MONTH() Excel function, ex.: =MONTH(A1), etc.
2) To get the average from particular month, say September (9th month), you need to enter the formula:
= SUMIF(C:C,"=9",B:B)/COUNTIF(C:C,"=9")
If you want the average for different month, you just change the 9 in SUMIF and COUNTIF.
You could make a pivot table, then drag the date in row field and values in value field. Then change the field setting of the values to 'average'.

How do I write an excel formula to count the number of a value in one column based off of a date in another column?

I have a worksheet and I'm trying to do a simple Count function, probably a countif but I'm unsure how to go about writing the formula.
I have two columns that I'd like to use for this formula.
Column N - I would like to filter for the Criteria of "C" or anytime a cell has a value of C
Column 0 - This column has dates filled in (short date format).
I would like to get a count of every C for each month, as simple as that.
In this example I filtered the date for May of 2017 and filtered for C under the Check column. We can see that there are 12 instances of C showing in the month of May 2017.
Does anyone know how to structure a formula that I would be able to Count the Number of C's for every month into the foreseeable future?
I figured out how to count the total present in a date range but unsure of how to add the date range plus Column N (Check) every time "C" is present in the cell.
=SUMPRODUCT((O:O>=DATEVALUE("5/1/2017"))*(O:O<=DATEVALUE("5/31/2017")))
Try this
=COUNTIFS(O1:O100,">="&A1,O1:O100,"<"&B1,N1:N100,"C")
Where A1 has the start date and B1 has the end date for that month. You can use DATEVALUE() instead of A1 and B1. Change as applicable
Screenshot
If you want to use SUMPRODUCT then see this
=SUMPRODUCT((O:O>=DATEVALUE("1/5/2017"))*(O:O<=DATEVALUE("30/5/2017"))*(N:N="C"))
In another column (lets say 'P' for example) I would insert a formula to give you the month number =Month(P7) - this will return 5 for May.
I would then use COUNTIFS (Like COUNTIF but it uses multiple criteria) to count where column N contains 'C' and column 'P' contains '5'.
=COUNTIFS(N:N,"C",P:P,5)
Try this....you need to select the entire Column B and named the column as 'Date'.enter image description here

Calculate SUM based on date

This is driving me nuts and I don't know what I'm doing wrong.
I have an excel table where my turnover is in with the date of incoming invoices. The date is in format ddmmjjj and is in column C.
I want to calculate my turnover on my dashboard. The total turnover is in column G.
The formula I use is:
=SUM(IF(MONTH(Sheet1!C:C)=2;Sheet!G:G;))
But this formula keeps giving me the total turnover... What am I doing wrong?
You need to use the SUMIF function in Excel, which allows you to sum up certain cells if the values in associated cells match a criteria:
SUMIF(range, criteria, [sum_range])
In your case, you'd want to extract the month for the dates in column C into another column (say column X holds the month for the dates in column C), and then:
=SUMIF(Sheet1!X:X, 2, Sheet1!G:G)
The formula you are using is correct, however you need to enter it as an array formula (via Ctrl + Shift + Enter).
=SUM(IF(MONTH(Sheet1!C:C)=2,Sheet1!G:G,0))

Resources