Google Sheet - COUNTIF - with multiple columns and criteria - google-sheets

I am trying to construct a COUNTIF function to pull out the number of "4" values of the "Status" column but considering only if the corresponding "gender" value is "1". From the image below you would expect to retrieve a total of 2.
Hope someone can help me with this. Thank you

As Irene Liberali said use COUNTIFS:
=COUNTIFS(A:A,4,C:C,1)

Related

Using COUNTIFS and getting error "Array arguments to COUNTIFS are of different size" in Google Sheets

I tried to calculate "TRUE" and "FALSE" in Calculation sheet, but I'm getting the error "Array arguments to COUNTIFS are of different size".
Any idea what I'm doing wrong?
Formula I'm using: =COUNTIFS(Data!A3:A,"0*",Data!B3:B,"Anna",Data!C3:C,B3,Data!D3:I,"TRUE")
Link to the sheet. In the sheet DATA you can find all data and in the sheet Calculation you can see some kind of overview data/results.
Goal: I want to count "TRUE" from multiple columns (depending on the test) but it should match with correct date, name and type of IDs).
try:
=SUMPRODUCT(FILTER(Data!D3:I, Data!B3:B=A3, Data!C3:C=B3)=TRUE)
for false use:
=SUMPRODUCT(FILTER(Data!D3:I, Data!B3:B=A3, Data!C3:C=B3)=FALSE)
update:
=SUMPRODUCT(IFNA(FILTER(Data!D:I, REGEXMATCH(Data!A:A&"", "^0.+"),
Data!B:B=$A3, Data!C:C=$B3)&""="TRUE"))
=SUMPRODUCT(IFNA(FILTER(Data!D:I, REGEXMATCH(Data!A:A&"", "^0.+"),
Data!B:B=$A3, Data!C:C=$B3)&""="FALSE"))

Match of an id value and extracing a string in Google Sheets

following problem:
I have a column with wrong Ids
Now I want to watch those wrong Ids with another sheet where I have same Ids and the correct link I want to match with those Ids:
So what I same up with is the following ->
=IFERROR(VLOOKUP(A2,'extract base'"B:F),"")"))
But obviously doesn't work haha. So basically very easy -> if the Id from Sheet 1 matches with the Id from Sheet two put in the second column (in my example custom_label) the value of sheet two column 2
Any help is appreciated, thank you so much!
Your current VLOOKUP formula is not structured correctly at all, and your sheet reference 'extract base'"B:F is also not written correctly. Have you read the basic documentation on VLOOKUP usage and syntax?
Delete B2:B entirely.
Then place the following in B2:
=ArrayFormula(IF(A2:A="",,IFERROR(VLOOKUP(A2:A,'extract base'!B:F,5,FALSE))))
This formula should provide results, if any, for all rows (assuming that your second sheet is, in fact, called exactly extract base).

Google Sheets: How to have the same values in column 4 whenever there are duplicate values in column 1?

The image explains what I would like to achieve probably the best:
The table I would like to create, at the moment I have only first three columns:
I would like the "New Volume" to have the same values whenever the keyword repeats. At the moment I have the three first columns but cannot figure out with what formula I can create the "New Volume" column.
I would appreciate the help.
This is a vlookup job.
=vlookup(D3;$D$3:$E$8;2;false)
It searches D column for identifier (also in column D) and returns value from second column. When vlookup is set as false, will always return first found value.
To avoid copying down the formula, you can nest it with arrayformula:
=ArrayFormula(ifna(vlookup(D3:D;$D$3:$E;2;false)))
My solution is here:
https://docs.google.com/spreadsheets/d/1RpSsb6DmUs6lcPmZ1R6uPW-a3iWs9XEnSpc3b3XiihI/edit?usp=sharing

google sheets (h)lookup last non-null value in specific column

I'm trying to populate a column with the last known price at the end of a batch of orders.
Please see an example attached.
I need the last price known from columns "price". Please note that there is not always value.
I tried something like this : =LOOKUP(B2:H2,"price",B3:H3<>"")
But it didn't really work.
(the nos 18 and 3 in column "I" are just examples. I need the green 3 results),thx.
Maybe try:
=INDEX(FILTER(B3:H3,B$2:H$2="price"),COUNTIFS(B$2:H$2,"price",B3:H3,"<>"))
If there could be empty gaps in your data, try this alternative:
=INDEX(A3:H3,MAX(COLUMN(A3:H3)*(A$2:H$2="price")*(A3:H3<>"")))

Google Script for Google Spreadsheet that, given two specific Sheet names, updates the dates from Sheet 2 to Sheet 1

I'm studying how to do that but I'm really just beginning and I find it very difficult to put in the code.
The situation:
I have 2 Sheets:
In Sheet 1 i have 8 columns named "ID" "Date1" "Date2" "Date3" "Date4" "Date5" "Date6" "Date7" on the first row. ID is a univocal String, dates are, well, dates.
In Sheet 2 I have multiple columns, that could be different and not in the same order, but among them, there will be the same "ID" "Date1" "Date2" "Date3" "Date4" "Date5" "Date6" "Date7" on the first row
What do I need?
The script should look for the first item in the column "ID" in Sheet 1, and search it in the column "ID" in Sheet 2. If it finds it, it should copy the dates values in the same row from Sheet 2 to Sheet 1.
Could you help me?
are you sure that you need a script for this?
because it can be easily achieved with just a simple formula called VLOOKUP
=ARRAYFORMULA(IFERROR(VLOOKUP(D:D, Sheet1!A:B, 2, 0)))

Resources