Forum Discussion

Brendan O'Shaughnessy's avatar
Brendan O'Shaughnessy
Copper Contributor
Sep 04, 2018
Solved

Assistance with Performing Mathematical Formulas with 2 Parts

Hi everyone,

 

I have a dataset that has a value (we'll say 2.1 million) and what I am looking to do is subtract out 3 million and then 20% of that value. Now I can do this by hand, but obviously, I have a ton of data and its gonna take forever by hand. 

 

2.1 million - 1.5 million = 600,000

20% of 600,000 = 120,000

 

The other issue is that I do not want a negative value, in case that the variable I enter results in a negative number I'd like it to be replaced with a 0. 

 

I'm open to suggestions from the community as to what I should try to do to accomplish this.

 

Thank you,

Brendan

  • is your data in 2 columns? I'm going to assume it is, and in column A and B.

     

    you could use a formula like this:

    =MAX(0,(A2-B2)*0.2)

    or

    MAX(0,(2100000-1500000)*0.2) = 120000

    MAX(0,(2100000-3000000)*0.2) = 0

4 Replies

  • Philip West's avatar
    Philip West
    Steel Contributor

    is your data in 2 columns? I'm going to assume it is, and in column A and B.

     

    you could use a formula like this:

    =MAX(0,(A2-B2)*0.2)

    or

    MAX(0,(2100000-1500000)*0.2) = 120000

    MAX(0,(2100000-3000000)*0.2) = 0

    • Brendan O'Shaughnessy's avatar
      Brendan O'Shaughnessy
      Copper Contributor

      You sir, have saved my fingers. That did the trick. I am very thankful. I wasn't sure it was possible to be honest, I am pretty good at Excel (my job has a bunch of classes on it) and this has broadened my horizons.

       

      Thank you again,

       

      Brendan

    • Brendan O'Shaughnessy's avatar
      Brendan O'Shaughnessy
      Copper Contributor

      Ah...


      Philip West wrote:

      is your data in 2 columns? I'm going to assume it is, and in column A and B.

       

      you could use a formula like this:

      =MAX(0,(A2-B2)*0.2)

      or

      MAX(0,(2100000-1500000)*0.2) = 120000

      MAX(0,(2100000-3000000)*0.2) = 0



       I thought about using MAX but wasn't sure how to format it to get what I wanted. Let me try that and I will see if it works. Thank you.