How to compare a date with financial year

G

Guest

I have a date in a cell and financial year in another cell.How to compare
whether that date exists in that financial year?.
example: cell a2=05-May-2007 and cell B2=2007-08.
What function will tell that a2 date exists in b2 financial year.
 
G

Guest

example: cell a2=05-May-2007 and cell B2=2007-08

Assuming the financial year runs from 1-Apr (this year) to 31 Mar (next
year), then one way to test for it, in say C2:
=AND(A2>=DATE(LEFT(B2,SEARCH("-",B2)-1),4,1),A2<DATE(LEFT(B2,SEARCH("-",B2)-1)+1,4,1))
 
J

JE McGimpsey

One way:

Since you didn't tell us when your financial year starts, I'll assume
it's 1 April to 31 March. Adjust (e.g., the 3) as necessary.

=IF(YEAR(DATE(YEAR(A2),MONTH(A2)-3,1)) = --LEFT(B2,4),"B2 Financial
Year", "Not B2 Financial Year")
 
G

Guest

Thank you both of you.Both are great...

JE McGimpsey said:
One way:

Since you didn't tell us when your financial year starts, I'll assume
it's 1 April to 31 March. Adjust (e.g., the 3) as necessary.

=IF(YEAR(DATE(YEAR(A2),MONTH(A2)-3,1)) = --LEFT(B2,4),"B2 Financial
Year", "Not B2 Financial Year")
 

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