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

Discuss the spreadsheet application

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

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: 35
Joined: Sun Sep 13, 2009 5:22 pm

### Re: I need a IF, AND, THEN function

Hallo

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

Pull down

Karolus
AOO4, Libreoffice - 5.1 … 5.3.2.2 on Linux Mint17

karolus
Volunteer

Posts: 843
Joined: Sat Jul 02, 2011 9:47 am

### Re: I need a IF, AND, THEN function

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.9.5.   The locale for any menus or Calc formulas in my posts is English (USA).

MrProgrammer
Volunteer

Posts: 3293
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

### Re: I need a IF, AND, THEN function

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: 35
Joined: Sun Sep 13, 2009 5:22 pm

Return to Calc

### Who is online

Users browsing this forum: Hagar Delest, macunaima5 and 29 guests