Logical condition

  • Thread starter Thread starter Hamid Ozair
  • Start date Start date
H

Hamid Ozair

Hi

I am trying to covert month into our fiscal year month.
Our fiscal year is from October thru September. I am
trying to IF with OR to change the month like this
If month is 1 (Jan), then give me 4. If month is 2 (Feb),
then give me 5 if month is 10 (Oct), then give me 1. My
problem is that Excel is allowing me to use 8 level IF
with OR when I try to add 9 level IF condition, it gives
me an error message "The formula you typed contains an
error".
The document says you can use 1 to 30 conditions but looks
like it is not true.
Any help will be appreciated.

Thanks,

Hamid
 
-----Original Message-----
Hi

I am trying to covert month into our fiscal year month.
Our fiscal year is from October thru September. I am
trying to IF with OR to change the month like this
If month is 1 (Jan), then give me 4. If month is 2 (Feb),
then give me 5 if month is 10 (Oct), then give me 1. My
problem is that Excel is allowing me to use 8 level IF
with OR when I try to add 9 level IF condition, it gives
me an error message "The formula you typed contains an
error".
The document says you can use 1 to 30 conditions but looks
like it is not true.
Any help will be appreciated.

Thanks,

Hamid
=IF((OR(E11=1)),4,(IF((OR(E11=2)),5,(IF((OR(E11=3)),6,(IF
((OR(E11=4)),7,(IF((OR(E11=5)),8,(IF((OR(E11=6)),9,(IF((OR
(E11=6)),9,IF(E11=8,11,E11))))))))))))))

I forgot to add the formula
 
Try this: =IF(A1<10,A1+3,A1-12+3)

This formula assumes that the current month is in cell A1, (i.e. i
February, 2 is in cell A1)
 
Hozair,

that looks like a pretty complicated formula for a pretty simple task.

Take a look at either mine, or Jason's formula
 
Thanks Jason and rbanks. Your formulas are very simple. I
never thought about writing formula like that.

Thank you guys one more time.

Hamid
 
Hi,

I have another problem. When I use this formula, it
ignores middle critera to add +3 and jumps to the last
critera to subtract -9

=IF(((FIXED(MID(TEXT((TODAY()),"DD-MM-YYYY"),4,2),FALSE)))
<10,((FIXED(MID(TEXT((TODAY()),"DD-MM-YYYY"),4,2),FALSE)))
+3,((FIXED(MID(TEXT((TODAY()),"DD-MM-YYYY"),4,2),FALSE)))-
9)


Any idea?

Thanks

Hamid
 
I found the problem. The problem was with FIXED function.
I changed it with VALUE function and it worked.

Thanks,

Hamid
 
=MID(TEXT((TODAY()),"DD-MM-YYYY"),4,2)

Not sure, but on this part of your code, would this do the same thing?

=MONTH(TODAY())

Looks like you wish to do something like this...

=IF(MONTH(TODAY())<10, True Part..., False Part...)
 
Back
Top