Max function not working on import range in google spreadsheet - google-apps-script

I am new to google spreadsheet functions and trying to apply formula in following way:
I have an imported range as under in cell B2:
=importrange("1gRRBtq7KMAr5kY5AJBqFcLarkikqrAqr5CbeTc5mPzE/edit#gid","dstr!b2:b400")
This range contains different dates & I am trying to select last date with following function in B1:
=max(B2:B398)
But in place of showing date it is showing value.
Please help in solving this concern, for more detail you can go to following page:
https://docs.google.com/spreadsheets/d/1HTXf4VG2JupiP9UqCLRyAddYjhsom1leQOI9-DwfMaY/edit#gid=0

I selected cell B1 and clicked on the 123-button (in the menubar) and formatted that cell as date. See if that helps ?

Related

How to get the value from another sheet with variable sheet name using Google Sheets?

I need to get the sheet name from a cell.
On image below I'm trying to get '4/2'!$AB60.
need to get the date which is 4/2 (cell D5)
combine it with !$AB60
now the cell D6 will have a formula value of '4/2'!$AB60
it will display the value.
Is there a way to formulate this instead of what I currently be doing, manually updating the each column dates (from C6 to AF6)? Is this even possible?
Formula from the screenshot: =JOIN(,LEFT(D5,LEN(D5),!$AB60)
The problem with this formula is !$AB60 as it is not a valid value, instead use "!$AB60" or use =TO_TEXT(D5)&"!$AB60". To use the result of this formula as a cell reference use INDIRECT, i.e.:
=INDIRECT(TO_TEXT(D5)&"!$AB60")

How to crossmatch data of a column with multiple column and take action if it matched?

Here I have two sheets in google spreadsheet.
Please check the screenshot
I would like to automatically search all the single data of column A of Sheet 2 in Column A and C of Sheet 1 and if it matched it would make the checkboxes ticked on column B and D of sheet 1 and if its not matched it would leave it as it was. I have attached that screenshot which is the result I expect. Is there any functions or script to do this?
I'm not familiar with such staffs. A help would be greatly appreciated.
Thanks
you do not need to write a script for this - an array formula can do it all
to the formula start working - you need to clear out everything from the range B1:B7 . then paste the formula =ArrayFormula(IFNA(VLOOKUP(A1:A7,Sheet2!$A:$A,1,false),)=A1:A7) into cell B1, then select range B1:B7 and paste checkboxes through the menu Insert - Checkbox
the formula for the range D1:D7 is inserted in the same way
=ArrayFormula(IFNA(VLOOKUP(C1:C7,Sheet2!$A:$A,1,false),)=C1:C7)
after some thought, came to the conclusion that the formulas could be much simpler
=ArrayFormula(COUNTIF(Sheet2!$A:$A,A1:A7)>0) for cell B1
=ArrayFormula(COUNTIF(Sheet2!$A:$A,C1:C7)>0) for cell D1

Weekday Values Script

I have a Google Sheet that I am writing a script for. My newest section of a macro code is supposed to fill column F with a weekday numerical value based off of column B which has values of date and time (MM/DD/YY hh:mm:ss). Once I added the section to the end of the macro code, it comes back with the Error Code "Exception: AutoFill destination range must extend the source range in only one direction." The code will add the value, but it doesn't correctly correspond to most days.
spreadsheet.getCurrentCell().setFormula('=WEEKDAY(B2, 1)');
spreadsheet.getActiveRange().autoFill(spreadsheet.getRange('F:F'), SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);
spreadsheet.getRange('F:F').activate();

Count the values from a variable column

I have a problem writing down a formula or a script in Google Sheet or Google App Script to find and count the values in a sheet where the number and references to the columns change.
I have a script that copy&paste the Sheet files for the staff shifts of every week from a Drive folder and merge them side by side (in horizontal).
In this sheet that contains all the shifts merged I want to count all the cells of the staff filtered only for handler and picker (column B, K, etc.) according to a specific date (row 3) for every hour.
Example: if today is 28/10/2020 find the right column with the same date in row 3 --> column E, count all the values from row 4 filtered by picker or handler for every hour (10 people at 05 AM).
Do you think that I can implement this with a formula (like a matrix, vlookup, etc.) or should it be written as a Script?
Thank you very much,
Marco
Please use the following
=COUNTA(QUERY({A3:I;J3:R},"select Col"&MATCH(A1,A3:I3)&"
where Col2 matches 'Technician|Picker' "))
Where B1 holds the date you wish to search for (28/10/2010)
Try the below formula. Replace date with your search date.
=COUNTA(INDEX(A4:R14,,MATCH(DATE(2020,10,28),A3:R3)))
This was earlier tagged as excel. This is how to "tackle" this in excel (office 365):
In a clear column use the following formula to get the unique hour-values that are in the column that equal today:
=UNIQUE(FILTER(INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0)),INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0))<>""))
In the column next to that type the following to get the result of the count of those unique values for that day:
=COUNTIF(INDEX(($4:$1048576,,MATCH(TODAY(),$3:$3,0)), FILTER (I:I,I:I<>""))
Where I:I in FILTER (I:I,I:I<>"") needs to be changed into the column you put the first formula.

IMPORTRANGE() based on the date of another cell?

I am trying to use IMPORTRANGE() to import a sheet from another spreadsheet. I am currently using the following formula.
=IMPORTRANGE("URL", B1&"!A1:R25")
However, I am getting stuck with the sheet name. B1 is a cell that shows a date, consequently I want to import the sheet with that date as its name. Also, B1 determines that date based on a formula; here it is
=(Leftb(Summary!$A$2,2)&"-"&Midb(Summary!$A$2,3,2)&"-"&rightb(Summary!$A$2,2))+7
I believe since B1 contains a formula like this, something is getting messed up in the importrange(), either the formula or the format of the date.
Your current formula gets the value of the date, not the date that is displayed in the UI.
Try this formula:
=IMPORTRANGE("URL", TEXTJOIN("",TRUE,B1)&"!A1:R25")