Excel function for SUMIF (RIGHT = RIGHT)? - excel

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))

Related

Sum cells that are in current Month in Microsoft Excel

I wish to calculate MTD (Month to Date) of some products. Let's say my data is
Product Sale Date
A 2 27/01/2022
B 4 26/01/2022
A 1 14/12/2021
I wish to sum A products that are sold this month. So my Sumifs function have two criteria. I tried use the below formula but it seems the month function is not working. Any tip is greatly appreciated
=SUMIFS(!B:B,!A:A,"A",!C:C,MONTH(TODAY()))
So you may use any one of the following,
Formula Used In Cell C6
=SUMPRODUCT((MONTH($C$2:$C$4)=MONTH(TODAY()))*($A$2:$A$4=B6)*($B$2:$B$4))
Formula Used In Cell D6
=SUM(IF((($A$2:$A$4=B6)*(MONTH($C$2:$C$4)=MONTH(TODAY()))),$B$2:$B$4))
Formula Used In Cell E6
=SUM(INDEX($B$2:$B$4*(TEXT($C$2:$C$4,"MMM")=TEXT(TODAY(),"MMM"))*($A$2:$A$4=B6),,))
Kindly remember you need to increase the range, i have just shown as per the sample data provided, hope it helps
A possible option is to create a new column "is todays month" with the formula =IF(NUMBERVALUE(MONTH(TODAY())-MONTH(C2))=0,1,0)
Then use =SUMIF(D2:D4,"1",B2:B4)
The sum of sales for product "A" in the current month:
=SUMPRODUCT($B$2:$B$4,(A$2:A$4="A")*1,(MONTH($C$2:$C$4)=MONTH(TODAY()))*1)

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

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)

(excel) Using COUNTIFS with OR

I hope that someone can offer a solution to the following formula.
=SUM(COUNTIFS(Table2[ColumnA],$AE$16,Table2[ColumnC],$A18,Table2[Date1],"<"&Table2[Date2],Table2[Date2],BLANK))
I want a count of matching values but for the last 2 I want to be an OR instead of what is presently there which I assume operates as an AND.
Specifically count if Date1 is less than Date2 or if Date2 is a Blank cell.
Thanks in advance.
If you use a additional column it will work easily:
Column A & B have your data, column C contain x if data2 is empty or > for comparision. Formula in column C is =IF(B2="","x",IF(A2>B2,">","")). Your result is delivered in cell E2 with formula =COUNTIF(C:C,"=?")
Formulas are translated from german Excel, i hope they will work fine.

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

How to do plus operation in SUM formula?

I have this excel sheet that need to be adjusted. I have this STOCK Quantity column (STOCK Qty) and I need it's column to be linked to the AZ column on sheet1. And it just not linked directly, but i need to plus 9 to get it linked to the exact column.
Here to explain it further. First i need to add this formula into the "STOCK Qty" column D2 : =SUM(Sheet1!AZ1) :
But then on the column after that, say column D3, D4 and so on, i need to add 9 to each column. So column D3 will have the formula of =SUM(Sheet1!AZ10) and D4 will have the formula of =SUM(Sheet1!AZ19) and so on :
So, i hope that you could understand my question. Thanks in advance! :)
You can use INDEX function with ROWS to increment by 9 each row - try this formula in D2 copied down
=INDEX(Sheet1!AZ:AZ,9*(ROWS(D$2:D2)-1)+1)
Note you probably don't need SUM, either with this formula or yours because its only a single value
I will use the offset function, instead
=SUM(OFFSET(Sheet1!$AZ$1,(ROW()-2)*9,0))
In addition, if you are not summing anything, just
=OFFSET(Sheet1!$AZ$1,(ROW()-2)*9,0)

Resources