Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do an If Else in google sheets?

Right now I'm trying to figure out whether a cell contains one of two values, it will then perform an operation which depends on whatever value is in said cell. This is the function I have so far:

=IF(ISNUMBER(SEARCH("btc", I2)), (E2*(1+10%)-D2),""), IF((ISNUMBER(SEARCH("pp",I2)),E2-D2,""))

However I found that you cannot do 2 if statements in the same cell.

like image 291
Asubaba Avatar asked Mar 21 '17 21:03

Asubaba


People also ask

How do I create an IF function in Google Sheets?

Open a spreadsheet in Google Sheets. The select cell you'd like to add an if statement (I decide to update on the F column) and double click on the related cell. Then type =IF then you can see that list of formulas will drop on. just select =IF and press ENTER button.

CAN YOU DO IF statements in Google Sheets?

In Google Sheets, the if function allows you to check a condition and return a specific value if it's TRUE.

Can you have multiple if statements in one cell Google Sheets?

One great example of this is the IF statement. In Google Sheets, you can nest multiple IF statements together to check your data and return different values depending on the results. This is a very useful skill to learn. In this tutorial, I will show you how to put multiple IF statements in one cell in Google Sheets.


1 Answers

Put your second in the false of the first instead of the "". It is called nesting:

=IF(ISNUMBER(SEARCH("btc", I2)), (E2*(1+10%)-D2),IF(ISNUMBER(SEARCH("pp",I2)),E2-D2,""))
like image 104
Scott Craner Avatar answered Oct 22 '22 19:10

Scott Craner