Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a formula "=month(B2)+2" which works fine, but i have 2006 & 2007 data
next to eachother, SO...if I have 5/1/07 it responds with 7 instead of 19...whereas 5/1/06 returns 7 which is correct. could I use an IF formula for this? the only thing is the IF formula only allows 7 formulas where this might need 24; 1 for each month... |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
hi,
try something like this... =IF(YEAR(NOW())=YEAR(A10),MONTH(A10),IF(YEAR(NOW() )-YEAR(A10)=1,MONTH(A10)+12,IF(YEAR(NOW())-YEAR(A10)=2,MONTH(A10)+24))) you can string it out for 7 years. change cell references to fit your data. regards FSt1 "bmo" wrote: I have a formula "=month(B2)+2" which works fine, but i have 2006 & 2007 data next to eachother, SO...if I have 5/1/07 it responds with 7 instead of 19...whereas 5/1/06 returns 7 which is correct. could I use an IF formula for this? the only thing is the IF formula only allows 7 formulas where this might need 24; 1 for each month... |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=12*(YEAR(B2)-2006)+MONTH(B2)+2
HTH Kostis Vezerides On Oct 10, 8:00 pm, bmo wrote: I have a formula "=month(B2)+2" which works fine, but i have 2006 & 2007 data next to eachother, SO...if I have 5/1/07 it responds with 7 instead of 19...whereas 5/1/06 returns 7 which is correct. could I use an IF formula for this? the only thing is the IF formula only allows 7 formulas where this might need 24; 1 for each month... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|