[Solved] I need a IF, AND, THEN function

Discuss the spreadsheet application

[Solved] I need a IF, AND, THEN function

Postby bulletbobb2 » Sat Nov 03, 2012 3:11 pm

Say that column A holds the numbers 1 thru 10.
In column B I want to put an 8 if the number in column A is between 4 and 6, otherwise I want to insert a 7.
I tried this with an IF function, but can't get it to work.
This is really involved with the NBA,time zones and DST. For a game during DST the column gets a 7, during ST it gets an 8, then later in the season a 7 again.
Any ideas?

Thanks,

Bob
Last edited by Hagar Delest on Mon Nov 05, 2012 4:59 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 2.4 on Windows XP
bulletbobb2
 
Posts: 33
Joined: Sun Sep 13, 2009 5:22 pm

Re: I need a IF, AND, THEN function

Postby karolus » Sat Nov 03, 2012 3:22 pm

Hallo

Code: Select all   Expand viewCollapse view
=7+((A1>=4)*(A1<=6))


Pull down

Karolus
AOO4, Libreoffice 4.2 on Linux Mint16
User avatar
karolus
Volunteer
 
Posts: 350
Joined: Sat Jul 02, 2011 9:47 am

Re: I need a IF, AND, THEN function

Postby MrProgrammer » Sat Nov 03, 2012 7:58 pm

bulletbobb2 wrote:I tried this with an IF function, but can't get it to work.
There's an example of using IF and AND near the bottom of section 9. Using functions and cell ranges in Ten concepts that every Calc user should know.

karolus wrote:Pull down
Specifically, enter the formula in the first row of column B, then Fill the formula down the column.

bulletbobb2 wrote:Say that column A holds the numbers 1 thru 10. … if the number in column A is between 4 and 6
Do you mean "if the number is 4, 5, or 6"? I would say that 5 is the only number among 1,2,3,4,5,6,7,8,9,10 that is "between" 4 and 6. Choose your words carefully or you may get incorrect advice.

If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
OpenOffice 3.2.0 Build 9483 on Mac OS X 10.6.8.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Volunteer
 
Posts: 1739
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: I need a IF, AND, THEN function

Postby bulletbobb2 » Mon Nov 05, 2012 4:56 pm

I meant 4,5, or 6.
I figured it out myself using an AND function, but karolus' idea seems simpler, so I'll have to try it.
Many thanks.

Bob
OpenOffice 2.4 on Windows XP
bulletbobb2
 
Posts: 33
Joined: Sun Sep 13, 2009 5:22 pm


Return to Calc

Who is online

Users browsing this forum: No registered users and 35 guests