I have the following formula in google sheets that returns the relevant cell value. I want to expand it for something else to to return a 1 if the cell is not blank, and 0 if it's blank:
=INDIRECT("'"&B$1&"'!g17")
Try this:
=IF(INDIRECT("'"&B$1&"'!g17")="",0, 1)
Related
I am using the filter function to find non blank values, the classic:
=FILTER(A2:A99, NOT(ISBLANK(B2:B99)))
To find all the column A headings that have a non-blank value in column B.
But I would also like to always include the last value regardless of it's ISBLANK, something like:
=FILTER(A2:A99, (CELL("address",A2:A99)="$A$99") OR NOT(ISBLANK(B2:B99)))
But this gives me an error, leading me to the strange question of how do I get this to work:
=FILTER(A2:A99, CELL("address",A2:A99)="$A$99")
Or something similar?
As CELL function does not play well in array formulas, you can get addresses as strings for cells like this:
=ARRAYFORMULA(ADDRESS(ROW(A2:A99), COLUMN(A2:A99)))
As for your original problem, you can just add the last cell as the last row:
={FILTER(A2:A98, NOT(ISBLANK(B2:B98))); A99}
Or a dynamic version:
=FILTER(A2:A99, (NOT(ISBLANK(B2:B99))) + (ROW(A2:A99) = (ROWS(A2:A99) + ROW(A2) - 1)))
Conditional Formatting - If a value in column A of sheet 1 appears twice in column b of sheet 2, highlight the cell in sheet 1
I've been messing with the indirect modifier to see if I can get this to work.
=COUNT(INDIRECT("'Order Confirmation'!B:B"),A1)
But this has currently just highlighted all the cells on sheet 1 column a. I have tried
=COUNT(INDIRECT("'Order Confirmation'!B:B"),A1>2)
=COUNT(INDIRECT("'Order Confirmation'!B:B"),A1=2)
and this has changed nothing. I would appreciate some assistance
if Sheet2 is like:
then Sheet1 will be like:
=FILTER(A1, COUNTIF(FILTER(INDIRECT("Sheet2!B:B"),
COUNTIF(INDIRECT("Sheet2!B:B"), INDIRECT("Sheet2!B:B"))>1), A1))
UPDATE:
=FILTER(A1, COUNTIF(FILTER(INDIRECT("'Order Confirmation'!B:B"),
COUNTIF(INDIRECT("'Order Confirmation'!B:B"),
INDIRECT("'Order Confirmation'!B:B"))>1), A1))
...as a custom formula because you have numbers in dataset not text
I have a lot of arrayformulas wrapped around countif and sumifs functions. I want the countifs/sumifs to return an empty value ("") instead of 0.
My workaround is very expensive and long:
=ARRAYFORMULA(IF(SUMIFS(Sheet!$C$1:$C; 'Sheet!$A$1:$A; ">="&$A3; Sheet!$A$1:$A; "<="&$B3)=0; ""; SUMIFS(Sheet!$C$1:$C; Sheet!$A$1:$A; ">="&$A3; Sheet!$A$1:$A; "<="&$B3)))
Here is an example sheet: https://docs.google.com/spreadsheets/d/1xyS0Y4gnG3zLyOGtycWytvTlA1NmqjEAy8H7QJatdSg/edit?usp=sharing
Is there a different way for this?
=IFERROR(SUM(QUERY(Sheet2!A:C;
"select C
where month(A)+1="&MONTH(A3)&"
and year(A)="&YEAR(A3); 0)))
=IFERROR(SUM(FILTER(Sheet2!C:C;
YEAR(Sheet2!A:A)=YEAR(A3); MONTH(Sheet2!A:A)=MONTH(A3))))
In the image above, how do I replace the portion "Tom.A:C" in the vlookup function with the text in cell B2 + .A:C ?
Where "Tom" is the name of a sheet in my workbook and I want to lookup a value in the second column of that sheet.
The formula
=VLOOKUP(lookup,sheet!range,column,match)
Then, in your example, you must write it like this:
=VLOOKUP(A2, TOM ! [Range of the sheet], 2, FALSE)
Edit:
I did not understand the first time exactly what was the question, so here it is the answer:
The formula
=VLOOKUP(lookup,indirect(concat(<cell with sheetname>,<"!"|".">,"<CELL RANGE IN ALL LOOKING SHEETS>")), column, match)
Then in your example:
=VLOOKUP(A2, indirect(concat(A2,".","A:C")), 2, 0)
First you need to concatenate the value of the sheet and range that you want, then with indirect, you take that string value and use it as a valid reference.
I'm using LotusScript to clean and export values from a form to a csv file. In the form there are multiple date fields with names like enddate_1, enddate_2, enddate_3, etc.
These date fields are Data Type: Text when empty, but Data Type: Time/Date when filled.
To get the values as string in the csv without errors, I did the following (working):
If Isdate(doc.enddate_1) Then
enddate_1 = Format(doc.enddate_1,"dd-mm-yyyy")
Else
enddate_1 = doc.enddate_1(0)
End If
But to do such a code block for each date field didnt feel right.
Tried the following, but that isnt working.
For i% = 1 To 9
If Isdate(doc.enddate_i%) Then
enddate_i% = Format(doc.enddate_i%,"dd-mm-yyyy")
Else
enddate_i% = doc.enddate_i%(0)
End If
Next
Any suggestions how to iterate numbered fields with a for loop or otherwise?
To iterate numbered fields with a for loop or otherwise?
valueArray = notesDocument.GetItemValue( itemName$ )
however do you know that there is a possibility to export documents in CSV format using Notes Menu?
File\Exort
Also there is a formula:
#Command([FileExport]; "Comma Separated Value"; "c:\document.csv")
Combined solution of Dmytro, clarification of Richard Schwartz with my block of code to a working solution. Tried it as an edit on solution of Dmytro, but was rejected.
My problem was not only to iterate the numbered fields, but also store the values in an iterative way to easily retrieve them later. This I found out today trying to implement the solution of Dmytro combined with the clarification of Richard Schwartz. Used a List to solve it completely.
The working solution for me now is:
Dim enddate$ List
For i% = 1 To 9
itemName$ = "enddate_" + CStr(i%)
If Isdate(doc.GetItemValue(itemName$)) Then
enddate$(i%) = Format(doc.GetItemValue(itemName$),"dd-mm-yyyy")
Else
enddate$(i%) = doc.GetItemValue(itemName$)(0)
End If
Next