Multiple formulas based on value of a cell

Meg83

New Member
Joined
Mar 17, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm hoping to get some help on this - been struggling for the last two days to get it to work. I want to create a formula where if the value in cell D1 is blank or 0, it returns 0, but if the value is greater than 0 apply the following formula: SUMIF(D2,">=1",A2)+((D2-1)*B2)

1679067424476.png


Basically if the I want a 0 value if the quantity is 0, if the quantity is 1 the return value should be 10, if the quantity is 2 the value should be 15 and then increase by 5 for each addition to the quantity.

I almost got it to work with this formula - but it returned a value of FALSE when the quantity was 1:
=IF(AND(D2>=0,D2<=0),D2*0,IF(D2=1,D2<1,SUMIF(D2,">=1",A2)+((D2-1)*B2)))


Any advice would be greatly appreciated.
Thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi & welcome to MrExcel.
Could D2 ever be less than 0, if so what should happen?
 
Upvote 0
Excel Formula:
IF(D2,SUMIF(D2,">=1",A2)+((D2-1)*B2),0)
 
Upvote 0
Solution
So what should happen if it's less than 0?
 
Upvote 0
that worked - I knew there had to be a simple solution - I was over thinking it.

THANK YOU THANK YOU THANK YOU!!
I am glad it works for you. However, kindly check if it's giving a desired output when D2 is negative, as pointed by Fluff.
 
Upvote 0

Forum statistics

Threads
1,215,048
Messages
6,122,862
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top