# Addition with 2 formulas in one

#### justn

##### New Member
Hi, new to this forum and excel. I'm starting to understand the basics with the formulas but this one I can't figure out. I need to take 2 numbers and if they are greater than 50 divide by 20, if less than 50 divide by 10, then add 2 other set of numbers separately and then add my answers to get a final answer.

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### etaf

##### Well-known Member
you can use IF to do that

but just need the detail

you have cells with two numbers and when added together is that what we are trying to evaluate ?

so assume cells are a1 and a2

=IF( (A1+A2) > 50 , (A1+A2)/20 , (A1+A2)/10 )

where are the other numbers - ?

need the detail and what to do if the result is 50 ?

#### justn

##### New Member
Thanks for the quick response etaf, ok this is what i want to do maybe i didnt explain it right.I'll try again, first i want to subtract (A1-A2) if this result is >50 i want to divide the # by 20, if the number is <50 i want to divide the number by 10 and then i want to add this # to lets say (A3+A4)

I'm trying to get an answer then dividing that answer by either a 20 or 10 depending if its >50 or <50 then adding it to the answer from (A3+A4)

#### Jonmo1

##### MrExcel MVP
Perhaps

=IF(A1-A2 > 50,(A1-A2)/20,(A1-A2)/10)+(A3+A4)

#### etaf

##### Well-known Member
=IF(A1-A2 > 50,((A1-A2)/20)+(A3+A4),(A1-A2)/10)+(A3+A4))

what happens if it = 50 ?

#### justn

##### New Member
Sorry should be greater or equal to 50 divide by 20

#### etaf

##### Well-known Member
=if(a1-a2 >= 50,((a1-a2)/20)+(a3+a4),(a1-a2)/10)+(a3+a4))

#### justn

##### New Member
they both work great but one question how do i get the larger number to be used first when subtractiing I found this from someone =max(A1:B1)-min(A1:B1) but how do i incorporate it all in 1 line

Last edited:

#### Jonmo1

##### MrExcel MVP
Change all refs to A1-A2 to ABS(A1-A2)

#### justn

##### New Member
tried =IF(ABS(A1-A2) > 50,ABS(A1-A2)/20,ABS(A1-A2)/10)+(A3+A4) window pops up with an error, sorry about the questions Jonmo1 maybe formula to complicated for a newbie..lol

Replies
19
Views
702
Replies
1
Views
144
Replies
3
Views
501
Replies
1
Views
339
Replies
6
Views
548

1,195,635
Messages
6,010,829
Members
441,569
Latest member
PeggyLee

### 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.

### Which adblocker are you using?

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

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