SUMIF or INDEX - finding sum that meets date within date range - excel

This seems like it should be pretty simple. I am trying to get the sum of values for everyday in a given month.
I would like the formula in K2 to find the sum of all quantities when the City is Houston and 9/1 is found between the start and end date range in columns E and F. So forth and so on.. I'm just not sure if I could do a SUMIF for multiple criteria with matching the city and then the date being found in the same date range.
Hope this is possible -- thank you!

use SUMIFS()
=SUMIFS($D:$D,$C:$C,SUBSTITUTE(K$1," Total",""),$E:$E,"<=" & $J2,$F:$F,">=" & $J2)

Related

Excel function for SUMIF (RIGHT = RIGHT)?

It's probably a quick one, but I'm desperate...
How can I put 2 corresponding RIGHT functions into a SUMIF? Or does this need VBA?
The case:
I want the sum of B:B, if any cell of J:J has the same last 4 numbers as A1.
EDIT
Column J shows the date an invoice was payed (e.g. "14. November 2020"). A1 is the headline and includes "Income 2020".
The sum in B14 should show how much money came in in the year the sheet is representing.
SUMIF(RIGHT(J:J;4);RIGHT(A1;4);B:B)
May someone enlighten me?
Thanks a lot!
Thomas
If column J contains true dates, then you can use SUMIFS and DATE:
=SUMIFS(B:B;J:J;">="&DATE(RIGHT($A$1;4);1;1);J:J;"<="&DATE(RIGHT($A$1;4);12;31))
This isn't working because the value in column J is a date. You should use SUMIFS and use a date range.
=SUMIFS(B:B,J:J,">="&DATE(RIGHT(A1,4),1,1),B:B,"<="&DATE(RIGHT(A1,4),12,31))

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

Lookup value next to the first number in column

I need a formula that can find the date in a cell next to another that has the first number in the column.
In column A I have dates and in column B onward I have stock prices. The dates goes back to 1990 daily, but not all the stock prices starts there. All of the prices end at 20-05-2015.
For all the stocks, I need to find out how many days they have been traded. I have the end date, but I need to look up the start date.
Therefore, I need a formula that says "Lookup the first cell which is numeric in column B, and take the corresponding cell in column A".
Thank you
You can use an array formula like this, assuming you have up to 1000 rows of data
=INDEX($A1:$A1000,MATCH(TRUE,ISNUMBER(B1:B1000),0))
confirm with CTRL+SHIFT+ENTER

Excel formula to average selected cells based on certain criteria

I am using Excel 2003.
I have a table:
Date - Column X - Column Y - Column Z - Age
I want to find the AVERAGE for the numbers in the Age Column where the Date in the Date colum = cell A1
There are hundreds of records - I have tried using INDEX and MATCH but cant get it to work. I only end up with the first matching record.
Any help would be appreciated.
Thanks.
Tom
Please try:
=AVERAGE(IF(X:X=A1,Z:Z))
with Ctrl+Shift+Enter
Tom:
I'm not sure if Excel 2003 has AVERAGEIF(), but if it does, use that. You designate your criteria range, criteria, and average range, and it does the rest.
If Excel 2003 does NOT have AVERAGEIF(), then you could use SUMIF() to get the sum of Ages on a certain date and then divide that by a COUNTIF() that counts the ages that occur on your date.
Hope that helps,
Matt via www.ExcelArchitect.com

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

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

Resources