Page 1 of 1

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

Posted: Sat Nov 03, 2012 3:11 pm
by bulletbobb2
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

Re: I need a IF, AND, THEN function

Posted: Sat Nov 03, 2012 3:22 pm
by karolus
Hallo

Code: Select all

=7+((A1>=4)*(A1<=6))
Pull down

Karolus

Re: I need a IF, AND, THEN function

Posted: Sat Nov 03, 2012 7:58 pm
by MrProgrammer
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.

Re: I need a IF, AND, THEN function

Posted: Mon Nov 05, 2012 4:56 pm
by bulletbobb2
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