Hi.
I just can not figure this out and I hope someone can help me.
What I want to achieve is this:
IF cell A1 contains word ”Sawlaskoup” THEN add word ”v1” to cell A2. BUT IF cell A1 contains word ”Ivac” THEN add word ”v2” to cell A2.
Hi.
I just can not figure this out and I hope someone can help me.
What I want to achieve is this:
IF cell A1 contains word ”Sawlaskoup” THEN add word ”v1” to cell A2. BUT IF cell A1 contains word ”Ivac” THEN add word ”v2” to cell A2.
Last edited by AliGW; 10-08-2021 at 04:34 AM.
Welcome to the forum.
I don’t use Google Sheets, but in Excel it could be done like this (in A2):
=IF(A1="Sawlaskoup","v1",IF(A1="Ivan","v2",""))
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Hi, and thank you for your quick reply!
It worked flawlessly! Huge thanks to you
However, I just ran into a new problem. I want to be able to input other words to A2 aswell (without the code). Is it possible to make this code do its work from another cell like B1?
Clarify what you mean - give an example. If you mean you want a formula AND manual entry in one cell, then no, that’s probably not possible (it certainly isn’t in Excel).
The idea I had was if =IF(A1="Sawlaskoup","v1",IF(A1="Ivan","v2","")) could do its work from cell B2, instead of A2. That the code is written in cell B2 instead, but still only affects cell A2.
No, that’s not possible (in Excel it would require VBA), unless A2 contained a formula (=B2).
I suspect (but don’t know) that Google Sheets will behave similarly. Hopefully a Google Sheets aficionado can confirm.
As an Google Sheets alternative, i can offer something like shown in the picture below where the main formula is entered in cell A2 and the result is seen in cell B2;
@Haluk, there is no need for any array {curly brackets} .. as described by AligW does exactly the same thing in either excel or google sheets
@janmorris;
I think you are missing the point.....
The formula suggested by AliGW returns the result in the cell which houses the formula. But, in my alternative; the expected result (i.e., the second element of the result array) will be shown in the adjacent cell.
I guess, something like this was required by the OP.
Last edited by Haluk; 10-08-2021 at 04:23 PM.
@Haluk, no i dont think i am. i will be quite forward with my response to this... i use Google Sheets enough to know that unless the cell must be clear so that it can take values from somewhere else then it is a pointless suggestion.
So, what do you think that the OP is asking for in his message #5 ?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks