OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Trouble with IF Statement

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
rliddle
Newbie
Newbie


Joined: 23 May 2012
Posts: 2

PostPosted: Wed May 23, 2012 9:32 am    Post subject: Trouble with IF Statement Reply with quote

I am trying to create an easy quote system. I have different prices based on quantity.

< 100 $1.10
100 - 300 .99
301 - 500 .89
500 up .79

I have been messing with the formula for a couple of days. This is the most recent.

It gives me FALSE


=IF(AND(B2<100;1.1);IF(AND(B2>=100<300;0.99);IF(AND(B2>=300<500;0.89);IF(B2>=500;0.79))))

Any help appreciated,
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Wed May 23, 2012 10:07 am    Post subject: Re: Trouble with IF Statement Reply with quote

=LOOKUP(B2;LookupScale)
With LookupScale being:
0 1.10
100 0.99
301 0.89
500 0.79
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
karolus
OOo Advocate
OOo Advocate


Joined: 22 Jun 2011
Posts: 210

PostPosted: Wed May 23, 2012 10:17 am    Post subject: Reply with quote

Hi
=VLOOKUP(B2;LookupScale)

Karo
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Wed May 23, 2012 10:30 am    Post subject: Reply with quote

karolus wrote:
Hi
=VLOOKUP(B2;LookupScale)

Karo


No. VLOOKUP takes 3 or 4 arguments.

=LOOKUP(B2;LookupScale)
OR
=LOOKUP(B2:column_1;column_2)
OR
=VLOOKUP(B2;LookupScale;2)
OR
=VLOOKUP(B2;LookupScale;2;1)
OR
=INDEX(column_2;MATCH(B2;column_1);1)
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
rliddle
Newbie
Newbie


Joined: 23 May 2012
Posts: 2

PostPosted: Wed May 23, 2012 2:39 pm    Post subject: Thanks all! Worked like a charm. Reply with quote

Your help is VERY much appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group