If statement question greater than or equal too

zoomaj

New Member
Joined
Jul 20, 2011
Messages
9
Hi guys,

i am trying to do an if statement and ran into some trouble! and need some help, its probably very simple but i cant figure it out,

basically i have a stock inventory with the amounts left displayed in percentages,

ie

100%
75%
50%
25%
0%



=IF(J11>=90,"STOCK OK",IF(J11=50,"HALF STOCK",IF(J11<=25,"25% STOCK LEFT",IF(J11<=0,"ORDER STOCK","ORDER STOCK"))))

im using the formula above, sometimes when i have 80% stock left it says order stock, any ideas why this is please? as im pretty sure< means less than?

cheers
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I dont really get what you are trying to do.
What should it say if you are between 89 - 51 and from 49-26?
 
Upvote 0
It's because you're not covering the whole range of values.

In your third If statement, there's
J11 <= 25 condition.

And in your first If statement, there's
J11 >= 90

while in your second If statement, there's only
J11 = 50

This means that any values you input between 90 and 25 (exclusive) except for 50 , it will print "ORDER STOCK" because it is the last FALSE statement.
 
Upvote 0
Hi guys thanks for your help so far,
your right iv not covered all the values any ideas on what i need to input to cover all the values please?

cheers

Anj
 
Upvote 0
Code:
=IF(A4<25,"ORDER STOCK",IF(A4=25,"25% STOCK",IF(A4<=50,"HALF(ish) STOCK","STOCK OK")))
 
Upvote 0
thank you salim it works, i can get moving forward now as i can see where i was going wrong, i wasnt covering all the values,

thank you
 
Upvote 0
Hi guys thanks for your help so far,
your right iv not covered all the values any ideas on what i need to input to cover all the values please?

cheers

Anj
You need to define what result you want based on an interval of values.

If you have 0 then obviously you have no stock.

So, you might define the intervals something like this...

0 = out of stock
Greater than or equal to 1 and less than or equal to 24 = ???
Greater than or equal to 25 and less than or equal to 49 = ???
Greater than or equal to 50 and less than or equal to 74 = ???
Greater than or equal to 75 = ???

Once you get the intervals CLEARLY defined we'll be able to make formula suggestions.
 
Upvote 0
Hi Valko

75 to 99 = stock ok
100 - full stock

your on the right lines,

salim helped but i do need a little more definition in my formula, please can you assist further?

kind regards

anj
 
Upvote 0
0 = out of stock
Greater than or equal to 1 and less than or equal to 24 = ??? 25% stock left
Greater than or equal to 25 and less than or equal to 49 = ??? half stock leftt
Greater than or equal to 50 and less than or equal to 74 = ??? order stock
Greater than or equal to 75 = ??? stock ok
100 = Full stock
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,696
Members
452,938
Latest member
babeneker

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