if statement with three different criterias?

G

Guest

I have a cell (B3) that has a number "7" and in cell (D3) I am trying to
write a formula to return the following:

If the cell is <6 I would like the formula return "Carton".
If the cell (B3) is between 7 and 12 I would like the formlua return "1/2
Pallet".
If the cell (B3) is 25 or greater, I want the formula to return "Full Pallet."

Thanks for the HELP,
 
P

Pete_UK

You don't say what you would like to do if B3 is between 12 and 25.
However, you might like to try this formula:

=IF(B3<=6,"Carton",IF(B3>=25,"Full Pallet",IF(B3<=12,"1/2 Pallet","not
specified")))

Hope this helps.

Pete
 
F

Fred Smith

You just need to nest the Ifs (and define what happens if be is between 13 and
24), as in:

=if(b3<6,"Carton",if(b3>=25,"Full Pallet","1/2 Pallet"))
 
L

Lee

I have a cell (B3) that has a number "7" and in cell (D3) I am trying to
write a formula to return the following:

If the cell is <6 I would like the formula return "Carton".
If the cell (B3) is between 7 and 12 I would like the formlua return "1/2
Pallet".
If the cell (B3) is 25 or greater, I want the formula to return "Full Pallet."

Thanks for the HELP,

This can be done with IF equations, but the easier way is to create a
user defined function (UDF) to return the value you want.

In the visual basic editor, insert a module and paste in the following
code:

Function Test(Value As Integer)
Application.Volatile

If Value < 7 Then
Test = "Carton"
ElseIf Value >= 7 And Value <= 12 Then
Test = "1/2 Pallet"
ElseIf Value > 25 Then
Test = "Full Pallet"
End If
End Function


Then, in cell D3, enter the following formula:

=Test(B3)


Hope that helps!
 
G

Guest

=IF(B3<6,"Carton",IF(B3<12,"1/2 Pallet,IF(B3>=25,"Full Pallet","")))

What do you want the result if B3 is between 13 and 24
 
G

Guest

Between 13 and 24 I would like the formula to return 1/2 Pallet.

Thanks for the help,
Tom
 
G

Guest

Or even:

=LOOKUP(B3,{0,1,7,13,25},{"","Carton","1/2 Pallet","","Full Pallet"})

or maybe:

=LOOKUP(B3,{0,1,7,13,25},{"","Carton","1/2 Pallet","3/4 Pallet","Full
Pallet"})

HTH
Jean-Guy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top