how to count sum for specific year in google sheet - google-sheets

i have data given below in Google Sheet
jumlah tanggal
1 Rp15.000 15-Apr-2020
2 Rp15.000 15-Mei-2020
3 Rp15.000 15-Jun-2020
4 Rp15.000 15-Jul-2020
5 Rp15.000 18-Agu-2020
6 Rp15.000 15-Sep-2020
7 Rp15.000 20-Okt-2020
8 Rp15.000 18-Nov-2020
9 Rp15.000 12-Des-2020
10 Rp15.000 11-Jan-2021
11 Rp15.000 15-Feb-2021
12 Rp15.000 15-Mar-2021
how can i only sum column "jumlah" only from year 2020?
[update]
i'm already follow some answer but it's still error

You could try:
=sumproduct(year(C2:C)=2020, B2:B)
You will need to exclude row 1 as C1 is not a date and year(C1) will give an error.
This formula creates a column of true/false values depending on whether the year is 2020 or not. Then multiples that column with the values in column B. And then adds it all up.

thank you for people who trying to help. So far i'm trying every solution above but it doesn't work. I googling many times for everyday then get the solution.
here's the formula:
=SUMPRODUCT((YEAR(C3:C)=2020)*B3:B)
here's the link to the sites:
https://www.excel-easy.com/examples/sumproduct.html

Related

Google sheet COUNTIF compare 2 cells in 2 differents columns

I have this kind of data in a google spreadsheet:
NAME AGE VALUE1 VALUE2
John 18 1 5
Tyron 22 5 4
May 18 1 6
Lewis 25 8 9
Donald 18 6 7
I wanna try to count how many occurrences where VALUE2 > VALUE1 and where age = 18
I tried something like that:
=COUNTIFS(B0:B10;18; B0:B10; D0:D10>C0:C10)
but that doesn't work
Someone to help?
Try below formula
=SUMPRODUCT(B2:B6=18,D2:D6>C2:C6)
FILTER() will also work.
=ArrayFormula(SUM(--(FILTER(A2:A6,B2:B6=18,D2:D6>C2:C6)<>"")))

Spreadsheet: Sum of dynamic number of rows

I have a table in my Google Spreadsheet that looks like this :
Row
(A) Some day
(B) Some data
1
day 1
5
2
day 2
10
3
total
4
day 1
8
5
day 2
7
6
day 3
9
7
total
Where I can have multiple "day rows", but I don't know how many. It can be only 1 like it can be 20 "day rows". And I want the "total row" to automatically do a SUM of the "day rows" above.
Result expected :
Row
(A) Some day
(B) Some data
1
day 1
5
2
day 2
10
3
total
15
4
day 1
8
5
day 2
7
6
day 3
9
7
total
24
Where B3 is equal to SUM(B1:B2) and B7 is equal to SUM(B4:B6)
I am trying to do that without the App Script, just using Spreadsheet native functions.
I think I should be using the SUM function or the Query function, but I don't know how to dynamically get the right range. Do you have any idea how to do that ?
Thank you
In your example, column B would be a mixture of constants and formulas. That would require a script to deposit the formulas. However with an extra column, you can avoid scripts. In C2 enter:
=if(A2<>"Total","",sum($B$1:$B1)-sum($C$1:C1))
and copy downwards:
Basically we add column B and subtract any previous Totals in column C.
Another approach is to place the following single array formula in C1:
=ArrayFormula(IF(A:A="",, SUMIF(IF(ROW(A:A),ROW(A:A)), "<="&ROW(A:A),B:B) - SUMIF(IF(ROW(A:A), ROW(A:A)),"<="& VLOOKUP(ROW(A:A)-1, FILTER(ROW(A:A), A:A="total"), 1, TRUE), B:B)))
If you only want to see the values for the "total" rows, change the opening
IF(A:A=""
to
IF(A:A<>"total"
The short version of how it works is that a sum is made of all values up to the current row in B:B, and from that is subtracted any values up to the last listing of the word "total" in A:A.
paste in each cell in B column where A column = total
=INDEX(SUM(IFERROR(1*INDIRECT(ADDRESS(MATCH(INDEX(
COUNTIFS({"total";A:A}, {"total";A:A}, {"total";A:A}, "=total",
{ROW(A:A);ROW()}, "<="&{ROW(A:A);ROW()})-1, ROW()+1, 1),
COUNTIFS({"total";A:A}, {"total";A:A}, {"total";A:A}, "=total",
{ROW(A:A);ROW()}, "<="&{ROW(A:A);ROW()}), 0), 2)&":"&
ADDRESS(ROW()-1, 2)), 0)))

Google Sheet: How to extract all values from a column which fulfils a condition to another column in Googlesheet using formula?

I have the below table in Sheet-1:
Name
Qty
CurVal
PrevVal
ABC
2
6.5
7.23
DCE
9
9.77
5.43
EFG
4
13
9.17
LKD
23
5.79
6.65
RSB
12
16.78
12.26
TYR
8
11.38
6.84
I would like to find and display only the Names, which fulfil below two conditions using Google Sheet formula:
PrevVal<8
CurVal>8
By these above conditions, I'm expecting to see Names==> DCE and TYR in Sheet-2.
Please help me out.
try:
=FILTER(Sheet1!A:A; Sheet1!D:D<8; Sheet1!C:C>8)
or:
=UNIQUE(FILTER(Sheet1!A:A; Sheet1!D:D<8; Sheet1!C:C>8))

Comparing a specific set of numbers

I have a google spreadsheet that has 6 cells with specific numbers in them. Every week, a series of numbers is entered in and I would like to flag the numbers in a separate column if they appear for that week. I was using the formula below where my numbers are in D2->I2 and the weekly ones would be in D18->I18 for example.
=arrayformula(sumproduct((D2:I2=D18:I18)))
Now, while this works, it's not quite what I'm trying to do. Unless the numbers match each other exactly, 1 2 3 4 5 6 to 1 2 3 4 5 6 then the addition doesn't happen. What I would like to have happen is that if, for example, the master column has 1 2 3 4 5 6 and the weekly column has 3 7 9 1 8 5 then the cell with the formula would display the value of 3 for matching three of the numbers that week.
Does anyone have a suggestion on how best to accomplish this?
See if this works ?
=ArrayFormula(sum(--regexmatch(D2:I2&"", join("|", D18:I18&""))))
with exclusion of empty cells in both ranges:
=iferror(ArrayFormula(sum(--regexmatch(to_text(filter(D2:I2, len(D2:I2))), "\b("&join("|", to_text(filter(D18:I18, len(D18:I18))))&")\b"))))

Sum of Hour and Time value in diffrent column in excel 2010

I have an Excel file which contains two columns for hours and minutes, like:
hr |min
---+---
7 | 2
10 | 16
9 | 12
I would like it to present in additional column as
07:02
10:16
09:12
How to do that in Excel 2010?
A B C
1 hr min hr:min
2 1 2
3 2 12
4 3 15
5 10 45
click on the cell C2 and put follwing formula at the formula bar and drag it for other rows.
=CONCATENATE(CONCATENATE(IF(A2 >9, A2, CONCATENATE("0",A2)),":"),CONCATENATE(IF(B2 >9, B2, CONCATENATE("0",B2))))
To get Sum of the of hr:min column
click on the cell where you want to display total and put follwing formula at the formula bar.
=CONCATENATE(CONCATENATE((SUM(A2:A5) + INT(SUM(B2:B5)/60)),":"),MOD(SUM(B2:B5),60))
Here you go
=SUM(TIME(A2,B2,0))

Resources