Google Spreedsheet calculate iside an IF statement - if-statement

Google spreadsheets help
Hi there! im new to google spredsheet and i really want to learn it, can someone explain to me why this wont work
IF(F2>E2*100, "yes","no")
. Im used to coding and so on but ii can't figure this one out!
What im trying to achive here is to check if The value inside F2 is bigger than the value inside E2*100. After that i vould like G2 to say either Yes or No.
I hope you undertsnad my question

It actually works. You just forgot to use "=" in front of the formula:
=IF(VALUE(F2)>VALUE(E2)*102;"yes";"no")
There is nothing wrong with that:

use:
=IF(F2>E2*100; "yes"; "no")

Related

Use the sheet number to check the active sheet

Before some code runs, I want to check it is the correct sheet.
I can use the sheet name, but my concern is that if someone changes the sheet name, the code won't run. The sheet index also seems to change if the sheet is moved.
Therefore I want to use something that doesn't change.
I believe the sheet number and sheet ID never change.
So I was hoping to use one of them, but I can't see a way of doing that.
What I want in non-coding language is:
If active sheet number = 4 then run the code or
If active sheet ID = 0123456789 then run the code.
Thanks to JPV's link, I have an answer and learned a few things.
You can't use the sheet number to check if the correct sheet is active.
You can use the getSheetId(), but the return you get is not useable.
To make it useable, you need to add getSheetId().toString().
To do the if statement, I needed two equal signs.
if (SpreadsheetApp.getActiveSheet().getSheetId().toString() == 0123456789) {do this when true}
I've been trying to solve this for days, so I should have come here and asked for help earlier.
The main thing I didn't know was the "toString()" part. It always seems so easy and obvious once I know.
Thank you, JPV.
Thanks to JPV's link, I have an answer and learned a few things.
You can't use the sheet number to check if the correct sheet is active.
You can use the getSheetId(), but the return you get is not useable.
To make it useable, you need to add getSheetId().toString().
To do the if statement, I needed two equal signs.
if (SpreadsheetApp.getActiveSheet().getSheetId().toString() == 0123456789) {do this when true}
I've been trying to solve this for days, so I should have come here and asked for help earlier.
The main thing I didn't know was the "toString()" part. It always seems so easy and obvious once I know.
Thank you, JPV.

set multiple Strings for the same index

I am new to Kotlin language, and I want to make a login/register app simple for training. I have a problem when I want to store the username and password inside a list but both in the same index for the same account. For example:
var login = mutableListOf<String?>({"username1","password1"} , {"username2","password2"})
I tried searching for a way to do this but i did not found an answer. Sorry if it is the wrong section as it's my first time on this forum, thank you in advance.
Your example looks more like a map, so consider using a map like
mapOf("username1" to "password1" , "username2" to "password2").
But if you definitely need list of lists then maybe
listOf(listOf("username1", "password1"), listOf("username2", "password2"))
is what you are looking for.
There is also a nice facility in Kt - Pair
listOf(Pair("username1", "password1"), Pair("username2", "password2"))

How to go back multiple pages in ionic 3

I have the page flow like below:
A->B->C->D
Somehow I will do a function in page"D", after it need to go back page"B".
How can I achieve that?
Using .pop() just can go back one page.
Using .push(B) is also not the solution, because the flow will become:
A->B->C->D->B
The solution I want is:
A->B
Anyone know how to achieve it? Thanks a lot.
this.navCtrl.popTo(this.navCtrl.getByIndex(this.navCtrl.length()-(N+1)));
Where N is the number of pages that you want to go back.
So if you want to go back 2 pages N=2
Try Using the popTo() method by giving the index of page in a parameter like below:
nav.popTo( this.navCtrl.getByIndex(1))

How to set word wrap in OO Basic Macro?

So I am pulling data from an Open Office Database and placing it in my Sheet.
I have this all working. However I would like to set word wrap and autofit on one of the cells to make sure it wraps and expands.
I get my cell like this:
oCell=oSheet.getCellByPosition(2,i)
This is working but I can't find the API to actually set those properties.
Thanks
The documented way seems to be:
oCell.setPropertyValue( "IsTextWrapped", True )

Casablanca: Assigning a Variable to a JSON Table Value

This is probably a simple question, but I have no idea as to the answer. I've tried googling it, but I don't know what to google. I need to assign a variable to a JSON table value (username string to username table value). I saw an example on MSDN with something like this:
obj2[L"password"] = json::value::string(U("password"));
However, if I remove the quotations and put in the variable name, it errors. I have a feeling this has to do with the "U". However, I honestly have no idea what that "U" is called (an iterator?) or how to change it. Could you help me out please?
I was finally able to find a solution to this problem after some searching and creative problem solving. There is little documentation on this issue, however, I did determine that the U is called a macro--in Casablanca it converts (almost) any type of string into a "utility::string_t" form. It does this literally, not accepting variables.
In order to solve this problem, I just declared 'password' and 'username' as:
utility::string_t password
utility::string_t username
And then worked with them as normal. Hope this helps anyone with the same issue out!
I have the same problem that you have. I tried your solution, but I could not make this to work:
utility::string_t text = "value1"; //no suitable constructor exists from const char to basic string
So looking for others method I found that this also works:
auto text = U("value1");
after that the assignment works too:
answer[L"key1"] = web::json::value::string(text);