COUNTIF other google sheet's A2 row by IMPORTRANGE - google-sheets

I am looking for a formula that will help me count other google sheet's D column matched with the current sheet row.
wait I am explaining!!!
I want to count the reg no. of D column of the student of (RM responses 20.08.2020) Sheet
according to that students reg no. (A2 row) value of (Attendance Counter) sheet.
So that I can scroll it down according to row.
[1]: https://i.stack.imgur.com/TcMI6.jpg
here is the formula:
=COUNTIF(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1mWtCKQggKUoGAn9td5nkjva6UBK5WHtq_NHBd-lEj8c/edit#gid=1023365212", " Form Responses 1!$D:$D; "A2"))"))
Here are links of the sheets:
Link (Attendance Counter): https://docs.google.com/spreadsheets/d/1PKk0y1yoi0smAYKfGwMkLSUkJLWtb0JwmWIVKdnOKoY/edit#gid=306895548
Link (RM Responses): https://docs.google.com/spreadsheets/d/1mWtCKQggKUoGAn9td5nkjva6UBK5WHtq_NHBd-lEj8c/edit#gid=1023365212

use:
=COUNTIF(IMPORTRANGE("1mWtCKQggKUoGAn9td5nkjva6UBK5WHtq_NHBd-lEj8c",
"Form Responses 1!D:D"), A2)

Related

How to correct XLOOKUP Formula result Error with query

i created year expenses sheet with query, xlookup formula in google sheet. now getting error with xlookup formula. can u check my google sheet and correct xlookup formula. i share my sheet
https://docs.google.com/spreadsheets/d/106FpEvx5NBo_bX_0XyBVBsZhotYqMFzGkMYI_JFpRwE/edit?usp=sharing
pl correct my xlookup formula
my code
=QUERY(DATA!B2:D, "WHERE B CONTAINS '"&XLOOKUP(B2,DATA!H2:H,DATA!I2:I)&"' ",0)
added formula to your sheet. Please check it out:
=ARRAYFORMULA(QUERY({DATE(RIGHT(DATA!B2:B,4),MID(DATA!B2:B,4,2),LEFT(DATA!B2:B,2)),DATA!C2:D},"SELECT *"&IF(B2="2022 ALL MONTH EXPENSES",," WHERE MONTH(Col1) = "&MONTH(XLOOKUP(B2,DATA!H3:H,DATA!I3:I))-1)))

Arrayformula with Vlookup matching Data in range

I am trying to use an ArrayFormula along with Vlookup with a range to match the data from another Worksheet. In my demo, the source sheet with Col B with orange and which is Col A is Stack but the destination sheet is not matching where orange exists. I can't understand where is my fault.
I have tried but it's wrong pulled.
=ARRAYFORMULA(VLOOKUP(B:B,IMPORTRANGE("13UCvlMfCse9A_fyVOPlQiwL6JADKZ3O2kMjUfznI-q0", "Source!A:B")},1))
Worksheet demo
I am expecting in the destination sheet that Col A matches Col B.
When using VLOOKUP, the first column of the range must be the search column. And you shouldn't omit the last parameter if you are looking for an exact match.
=ARRAYFORMULA(IFNA(VLOOKUP(B:B,QUERY(TO_TEXT(IMPORTRANGE("13UCvlMfCse9A_fyVOPlQiwL6JADKZ3O2kMjUfznI-q0", "Source!A:B")),"SELECT Col2, Col1"),2,0)))
update
=ARRAYFORMULA(IFNA(VLOOKUP(B:B,MAP({2,1},LAMBDA(col,INDEX(IMPORTRANGE("13UCvlMfCse9A_fyVOPlQiwL6JADKZ3O2kMjUfznI-q0", "Source!A:B"),,col))),2,0)))
With dynamic array formula MAP(), try-
=MAP(B1:INDEX(B1:B,COUNTA(B1:B)),LAMBDA(x,IFERROR(QUERY(INDEX(TO_TEXT(IMPORTRANGE("13UCvlMfCse9A_fyVOPlQiwL6JADKZ3O2kMjUfznI-q0", "Source!A:B"))),"select Col1 where Col2='" & x & "'"),"")))

Sum column based on header criteria in google sheets

I want to sum all the quantity sold in all orders here so that sheet will search for Q in column header if its there the sum the below no.
below is a link for my sheet
https://docs.google.com/spreadsheets/d/1viATMfTjVHSLrC1HTYKArmJBnrDfeNVj7oSIgdVzLH4/edit?usp=sharing
You can use SUMPRODUCT().
=SUMPRODUCT((C5:BJ)*(C4:BJ4="Q"))

Google Sheets transpose multiple columns with multiple data into Details in Rows

I have a table of responses from a google form (Columns A to G).
I need to transform the data into details, to be like the data shown in column K to O.
In Sheet2!G2 , I have put the formula that still needs to split the column K, then transpose it to vertical with the "Record" refers to Column J.
The spreadsheet is here: https://docs.google.com/spreadsheets/d/13yQa2HH5D-6gJWc9NPNUEdQNkhxicfZkc7LWJC5kUME/edit#gid=457678832
Thank you for helping out.
In Cell A18 (sheet2) I entered
={"Date","Grade","Subject", "Record"; query(ArrayFormula(SPLIT(FLATTEN(datevalue(Data!C2:C)&"|"&Data!D2:D&"|"&Data!B2:B&"|"&SPLIT(Data!E2:E,", ")), "|")), "Where Col4 <>''")}
See if that works for you?

Extract rows from one google sheet to another based on criteria in column

I have a google sheet called "Senate." In Column E, some of the rows have "ID" in that column. I would like to copy the rows that contain "ID" in Column E and paste them into another sheet called "Targets." It is important the rows are not taken from the original sheet "Senate"
Assuming that with 'sheet' you do mean sheet (tab) and NOT a spreadsheet (workbook), in sheet Targets, A1 try:
=query(Senate!A:Z, "where E = 'ID' ",1)
Change range to suit.

Resources