ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Bug with advanced if statment? (https://www.excelbanter.com/charts-charting-excel/124364-bug-advanced-if-statment.html)

H4X3R

Bug with advanced if statment?
 
Hello im using the follow if statment

=IF(C21250,C21*15%,IF(C21=500,C21*25%,IF(C21=10 00,C21*50%,"NO")))

it works fine but when it comes accross a number "1000" it doesnt times it
by 50% for e.g 1000*50% is ment to be 500 the if statment gives me 150 anyone
help thanks!

David Biddulph

Bug with advanced if statment?
 
1000 is greater than 250, so the answer from your first IF condition is
1000*15%. It doesn't get as far as any of the other tests.
You'll need to reverse the order of the tests.
--
David Biddulph

"H4X3R" wrote in message
...
Hello im using the follow if statment

=IF(C21250,C21*15%,IF(C21=500,C21*25%,IF(C21=10 00,C21*50%,"NO")))

it works fine but when it comes accross a number "1000" it doesnt times it
by 50% for e.g 1000*50% is ment to be 500 the if statment gives me 150
anyone
help thanks!




H4X3R

Bug with advanced if statment?
 
Hi David thanks,

i want ot to choose weather the number is between 250 and 499 and give a 15%
discount, weather the number is between 500 and 999 and give a 25% discount
and finally weather it is between 1000 or more and give a 50% diso**** how
can i do this

Thanks David!

"David Biddulph" wrote:

1000 is greater than 250, so the answer from your first IF condition is
1000*15%. It doesn't get as far as any of the other tests.
You'll need to reverse the order of the tests.
--
David Biddulph

"H4X3R" wrote in message
...
Hello im using the follow if statment

=IF(C21250,C21*15%,IF(C21=500,C21*25%,IF(C21=10 00,C21*50%,"NO")))

it works fine but when it comes accross a number "1000" it doesnt times it
by 50% for e.g 1000*50% is ment to be 500 the if statment gives me 150
anyone
help thanks!





Jon Peltier

Bug with advanced if statment?
 
As David suggested, reverse the order of tests in your IF statement.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"H4X3R" wrote in message
...
Hi David thanks,

i want ot to choose weather the number is between 250 and 499 and give a
15%
discount, weather the number is between 500 and 999 and give a 25%
discount
and finally weather it is between 1000 or more and give a 50% diso**** how
can i do this

Thanks David!

"David Biddulph" wrote:

1000 is greater than 250, so the answer from your first IF condition is
1000*15%. It doesn't get as far as any of the other tests.
You'll need to reverse the order of the tests.
--
David Biddulph

"H4X3R" wrote in message
...
Hello im using the follow if statment

=IF(C21250,C21*15%,IF(C21=500,C21*25%,IF(C21=10 00,C21*50%,"NO")))

it works fine but when it comes accross a number "1000" it doesnt times
it
by 50% for e.g 1000*50% is ment to be 500 the if statment gives me 150
anyone
help thanks!







H4X3R

Bug with advanced if statment?
 
=IF(C21=1000,C21*50%,IF(4=500,C21*25%,IF(C21=25 0,C21*15%,"N/A"))) works
w00t thanks all

"Jon Peltier" wrote:

As David suggested, reverse the order of tests in your IF statement.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"H4X3R" wrote in message
...
Hi David thanks,

i want ot to choose weather the number is between 250 and 499 and give a
15%
discount, weather the number is between 500 and 999 and give a 25%
discount
and finally weather it is between 1000 or more and give a 50% diso**** how
can i do this

Thanks David!

"David Biddulph" wrote:

1000 is greater than 250, so the answer from your first IF condition is
1000*15%. It doesn't get as far as any of the other tests.
You'll need to reverse the order of the tests.
--
David Biddulph

"H4X3R" wrote in message
...
Hello im using the follow if statment

=IF(C21250,C21*15%,IF(C21=500,C21*25%,IF(C21=10 00,C21*50%,"NO")))

it works fine but when it comes accross a number "1000" it doesnt times
it
by 50% for e.g 1000*50% is ment to be 500 the if statment gives me 150
anyone
help thanks!







David Biddulph

Bug with advanced if statment?
 
I hope you mean:
=IF(C21=1000,C21*50%,IF(C21=500,C21*25%,IF(C21= 250,C21*15%,"N/A")))
as in your second test below you've got IF(4=500,... which isn't often
true.
--
David Biddulph

"H4X3R" wrote in message
...
=IF(C21=1000,C21*50%,IF(4=500,C21*25%,IF(C21=25 0,C21*15%,"N/A"))) works
w00t thanks all

"Jon Peltier" wrote:

As David suggested, reverse the order of tests in your IF statement.


"H4X3R" wrote in message
...
Hi David thanks,

i want ot to choose weather the number is between 250 and 499 and give
a
15%
discount, weather the number is between 500 and 999 and give a 25%
discount
and finally weather it is between 1000 or more and give a 50% diso****
how
can i do this

Thanks David!

"David Biddulph" wrote:

1000 is greater than 250, so the answer from your first IF condition
is
1000*15%. It doesn't get as far as any of the other tests.
You'll need to reverse the order of the tests.
--
David Biddulph

"H4X3R" wrote in message
...
Hello im using the follow if statment

=IF(C21250,C21*15%,IF(C21=500,C21*25%,IF(C21=10 00,C21*50%,"NO")))

it works fine but when it comes accross a number "1000" it doesnt
times
it
by 50% for e.g 1000*50% is ment to be 500 the if statment gives me
150
anyone
help thanks!





All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com