Why doesn't this formula work? function works seperately but not as part of a bigger function.

Waboku

New Member
Joined
Jul 8, 2016
Messages
45
Hello, thanks for considering helping me with this.

I have this function:

=IF(OR(A2={"-1",-2}),5,IF(AND(A2>10),X2*0.9,IF(AND(10>=A2>=3),A2-1,IF(AND(3>A2),((A2-1)/2*0.1667+0.5)*A2))))

Some of the parts are just there because I don't know how to correctly trim down a function someone helped me with. The part that results in 5 is not needed and I think some of the AND's aren't needed. The problem I'm having is the function for if 3>A2 doesn't return the correct outcomes. If the function ((A2-1)/2*0.1667+0.5)*A2 is used on its own it returns the correct results.

As part of the whole function it does this:

<style>table { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 12pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; border: medium none; white-space: nowrap; }</style>
Column A
2.5

Returns
1.5
1.5
0.5
1
0

<colgroup><col style="width:65pt" width="65" span="2"> </colgroup><tbody>
</tbody>

On its own:

<style>table { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 12pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; border: medium none; white-space: nowrap; }.xl63 { }</style>
Column A
Returns
2.5
1.56
1.5
0.81
1
0.50

<colgroup><col style="width:65pt" width="65"> <col style="mso-width-source:userset;mso-width-alt:3029;width:71pt" width="71"> </colgroup><tbody>
</tbody>

The on its own results are what I'm looking for, if anyone knows why this is and how to fix it please let me know.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Maybe this
Code:
=IF(A2>10,X2*0.9,IF(AND(A2<=10,A2>=3),A2-1,IF(AND(A2<3),((A2-1)/2*0.1667+0.5)*A2)))
 
Upvote 0
Hello Michael M, thanks for your help. Because of your formula I was able to start making my own If(AND( functions.
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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