Even or Odd Year Function

D

Dave H

I am trying to use the Year Function =Year(A1). If A1 is actually
vlookup when I place the fubction in cell B1 it works fine. However i
I place =Year(vlookup(C1,Table,3,false)) in cell A1 it no longer work
correctly. Any ideas or suggestions. I am trying to come up with
formula that determines whether the year of a date is odd or even
 
L

Luke M

Your formula worked okay for me. What exaclty is displayed in A1 when you
enter your formula? Only thing I can suggest is to make sure the formula is
written correctly, and that it's correctly returning a serial (date).

for your end goal, I would suggest using ISEVEN or ISODD. Both of these are
included in the Analysis ToolPak add-in.
 
S

Sheeloo

What is the format of the cell being returned by VLOOKUP...

When you put the VLOOKUP in A1 and do =YEAR(A1), Year gets the value as
formatted by A1...
In =YEAR(VLOOKUP...) you it gets the value as returned by VLOOKUP...

If you have a date in A1 you can get wheter year is even or odd by using the
formula
=IF(MOD(YEAR(A1),2)=0,"Even","Odd")
 
R

rspowell

I am trying to use the Year Function =Year(A1).  If A1 is actually a
vlookup when I place the fubction in cell B1 it works fine.  However if
I place =Year(vlookup(C1,Table,3,false)) in cell A1 it no longer works
correctly.  Any ideas or suggestions.   I am trying to come up with a
formula that determines whether the year of a date is odd or even.

Dave --

Here is the Even -or- Odd part ...

ISEVEN(YEAR(A1))

-or-

ISODD(YEAR(A1))

Now - this does work if you substitute a VLOOKUP for the range
reference "A1"

-- you can do it all together - something like this ...

ISEVEN(YEAR(VLOOKUP("My Criteria",A1:B2,2,FALSE)))

-or-

ISODD(YEAR(VLOOKUP("My Criteria",A1:B2,2,FALSE)))

... tested it for you over here - this will work for sure

Hope it helps you !

- Rodney POWELL
Microsoft MVP - Excel

www.BeyondTechnology.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top