Home » excel » Excel function: IF a cell contains certain text, then a specific formula executes

Excel function: IF a cell contains certain text, then a specific formula executes

Posted by: admin May 14, 2020 Leave a comment

Questions:

Help would be appreciated guys 🙂

I’m creating a ledger and I’m a little confused on the IF,THEN function. My dilemma goes as follows:

Function for Cell E1:
    If cell A1 contains the word "BUY", then execute the formula: "B1 * C1"
        OR
    If cell A1 contains the word "SELL", then execute the formula: "(100 - B1) * C1"

Note: Cell A1 will contain ONLY one of two words, “BUY” or “SELL”

Any help would be appreciated, this is like Greek to me :/

How to&Answers:

Try this:

=IF(A1 = "BUY", B1 * C1, IF(A1 = "SELL", (100 - B1) * C1, ""))

Answer:

Try this in E1,

=if(b1="sell", 100 -b1, b1) * C1