Forum Discussion

kairoselvarro's avatar
kairoselvarro
Copper Contributor
May 08, 2021
Solved

Subtracting from the addition of 2 specific cells with a given condition / given conditions.

Hello.   I was messing around in Excel and I want to subtract from the addition of one specific cell to another, only if the product is larger than a given criteria. So e.g. B1=1500 , C8 = 5692 , ...
  • kairoselvarro's avatar
    kairoselvarro
    Jun 11, 2021

    NikolinoDE Okay, my bad...I'm literally a newbie at this...

    Let me just start by saying for all who are going to read this thread that I've solved my issue! I was messing around in Excel on my own and finally figured it out! But just to make it clear, I will outline the problem that I had up there ^ according to your "way" (for lack of better word...) and I'll also post how I solved it!

     

    Problem:

    A1 = 5

    A2 = 12

    B1 is the Formula (the one I had a problem with)

    I wanted to code the B1 cell with a formula that would allow me to set my own arbitrary conditions, and change its value accordingly. In this example, Condition = If (A1+A2) > 10, (A1+A2)-10.

    I don't know if that makes sense, but that's how clear-cut I can be...

     

    Solution:

    I fiddled around with the functions, and I realised that what I required wasn't a Mathematical function: it was a Logical one!

    so, all I had to do was use the IF function (it's pretty dumb of me tbh, now that I think about how I was sweating beads trying to figure that bit out...). It becomes like this:

    B1 =IF( (A1+A2)>10 , (A1+A2)-10 , (A1+A2) ) [LITERALLY type this expression into the cell]

    The IF Syntax is: =IF( logical_expression , value_if_true , value_if_false )

    So...for any beginners out there wanting to us the IF function like me about 2 weeks ago...this roughly translates to:

    Condition: (A1+A2) is more than 10.

    Value if true: if (A1+A2) is more than 10, subtract 10 from (A1+A2).

    Value if false: if (A1+A2) is not more than 10, return (A1+A2) i.e. don't do anything to (A1+A2).

    Using the data up there, A1+A2=17, so the B1 cell would return 7.

     

    I really hope this helps anyone out there!! I'm not a tech whiz myself, and I don't even know whether I have the right to give these tips in the first place but...if I was a newbie in Microsoft and asking the forum regarding something difficult, I would much rather have the help than having none at all. Thank you for being so ready to help me out NikolinoDE!! I really appreciate it :))

Resources