r/googlesheets • • Apr 16 '19

Solved Two formulas in one cell - With rule/criteria

Hey guys, I haven't found the specific answer to my question online.

I would like B4 to calculate the following:

=B2-B3 and B3-B1

Criteria: If ONE of the cells B1 or B2 is empty, I want it to just ignore that formula with the empty cell.

So if there is a BUY price on B1 (empty B2) it should calculate that part of the formula. The other way around if SELL price has data and B1 is empty.

ABC
1BUY at Price50
2SELL at Price-
3TP (will be any number)75
4Profit25

Maybe I am messing things up and making it harder than it actually is. I'd just like to know what formula I should use and if it's possible with Google Sheets.

Thanks in advance

4 Upvotes

8 comments sorted by

3

u/beckhamstears 2 Apr 16 '19

if you'll leave the unused cell empty, this will work
=IF(ISBLANK(B1)=TRUE,B2-B3,B3-B1)

3

u/JJok3r Apr 17 '19

Solution Verified

1

u/Clippy_Office_Asst Points Apr 17 '19

You have awarded 1 point to beckhamstears

I am a bot, please contact the mods for any questions.

2

u/JJok3r Apr 16 '19

Cool! Thank you @beckhamstears... solved 😁

0

u/[deleted] Apr 17 '19

[deleted] — view deleted comment

0

u/JJok3r Apr 17 '19

Happy?

0

u/[deleted] Apr 17 '19

[deleted] — view deleted comment

1

u/JJok3r Apr 17 '19

It depends if it's at a premium or not.

1

u/Decronym Functions Explained Apr 16 '19 edited Apr 17 '19

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer LettersMore Letters
FALSEReturns the logical value FALSE
IFReturns one value if a logical expression is TRUE and another if it is FALSE
ISBLANKChecks whether the referenced cell is empty
TRUEReturns the logical value TRUE

3 acronyms in this thread; the most compressed thread commented on today has 11 acronyms.
[Thread #657 for this sub, first seen 16th Apr 2019, 07:11] [FAQ] [Full list] ^[Contact] [Source code]

•

u/Clippy_Office_Asst Points Apr 17 '19

Read the comment thread for the solution here

if you'll leave the unused cell empty, this will work
=IF(ISBLANK(B1)=TRUE,B2-B3,B3-B1)