I have to check cells and when it is empty show MsgBox or something. So I`m looking for IsNull function or cell.length. Has BASIC some kind of this functions?
In OpenOffice I would use YourCell.String == ""
According to http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Cells_and_Ranges, you can check Cell.Type to see if it is equal to com.sun.star.table.CellContentType.EMPTY.
Related
I would like to put an AND statement within the below formula but I keep getting the error "You have entered too few arguments", is anyone able to help please?
=IF(ISNA(VLOOKUP(A2,$D$2:$D$4,1,FALSE)),"No","Yes")
Replace commas with semicolons and use AND function in IF condition.
Worked for me in google sheets.
=IF(AND(ISNA(VLOOKUP(A2;$D$2:$D$4;1;FALSE)); TRUE);"No";"Yes")
Hope it helps!
The following formula works to make a search using a custom formula
=SEARCH("release",$C:$C))
but dont work if I use the logical operator OR. Example :
=or(SEARCH("release",$C:$C),SEARCH("prod",$C:$C))
Is there a way to solve this issue?
try:
=(SEARCH("release", $C:$C))+(SEARCH("prod", $C:$C))
or:
=REGEXMATCH($C:$C, "release|prod")
I am trying to create a field in Google Data Studio that sums the revenue for lists that begin with US. I know I have to use regex, but it continue to tell me there is an unexpected end to the formula.
Here is the code.
Revenue WHERE REGEXP_MATCH(List, '^US')
Please let me know if you have any questions.
Thanks!
You can use
WHERE REGEXP_MATCH(List, '^US.*')
^^
Or even
WHERE REGEXP_MATCH(List, 'US.*')
See REGEXP_MATCH documentation:
REGEXP_MATCH attempts to match the entire string contained in field_expression. For example, if field_expression is "ABC123":
REGEXP_MATCH(field_expression, 'A') returns false.
REGEXP_MATCH(field_expression, 'A.*') returns true.
background info - not important
I realise I need improvement on understanding logic and understanding documentation when playing around with Android apps. So, I thought I'll switch to Google Sheets in the hope of some basic practice in a context I might find easier to understand.
question
I've set up a Google Sheet:
https://docs.google.com/spreadsheets/d/1T7q_CGMFObxS_0DGikUdSdLTf97XmEPXY0S7yItuA5Y/edit?usp=sharing
I would like Column B to:
display "Folder1" if "Black" is found in the adjacent Column A cell.
display "Folder2" if "Blue" is found in the adjacent Column A cell.
display "Folder3" if "Green" is found in the adjacent Column A cell.
and to then be able to add more conditions.
My formula for Column B is currently:
=ARRAYFORMULA(
IFS(
find("Black", A2:A,1)>0,"Folder1",
find("Blue", A2:A,1)>0,"Folder2",
find("Green", A2:A,1)>0,"Folder3")
)
Which is only meeting the first condition "Folder1" if "Black" is found and not continuing with the rest of the if clauses.
I think I have nested it correctly though because all of the IFS() are at the same level with their corresponding find() within. And, I have two closing brackets which close the IFS and the ARRAYFORMULA.
Am I just simply not using the right kind of functions for what I'd like to do?
Thank you for your suggestions on how I can solve this!
The problem is that find() only returns a number > 0 if it actually finds a match. Otherwise it returns an error which you can't test for explicitly.
You can fix you code like this:
=ARRAYFORMULA(
IFS(
isnumber(find("Black", A2:A,1)),"Folder1",
isnumber(find("Blue", A2:A,1)),"Folder2",
isnumber(find("Green", A2:A,1)),"Folder3")
)
Now we can test that what find() returns is an number and the code will work!
Obviously, I put on multiple lines for clarity.
I need a little help with my calculator program. I have created the code for the main buttons like the numbers 0-9 and the arithmetic operators to make it perform simple calculations.
What I'm having problems with right now is making the CE button work, after clicking the CE button I need the last entered character to be removed from the display label.
I have tried to adapt this code somehow, but it doesn't work:
lblResult->substr(0, lblResult->size()-1);
I know I'm doing somehting wrong here, can you please help me?
Thanks in advance
...Now that we know that lblResult is a System.Windows.Forms.Label, we can look at the documentation.
A Label has a Text Property, which is a String^ (i.e. a string reference).
For what you want to do, the Remove Method of String is appropriate. But note in the documentation it says that it "Returns a new string in which a specified number of characters from the current string are deleted." This means that it does not modify the string, but returns a modified copy.
So to change the label's text, we need to assign to its Text property what we want: the current string with all of the characters except the last:
lblResult->Text = lblResult->Text->Remove(lblResult->Text->Length - 1);
lblResult->resize(lblResult->size() - 1);
In this case you can use components Remove and Length methods.
Use the following code to access the components text:
component->Text
Than remove the last character of string by accessing Remove and component Length method
= component->Text->Remove(component->Text->Length - 1)
I hope you find this useful.
Just asking the obvious -- the whole statement is
*lblResult = lblResult->substr(0, lblResult->size()-1);
right?