Date Calculation

  • Thread starter Thread starter Samir
  • Start date Start date
S

Samir

I need to write a formula or VB code for the following:

Say Column A contains dates and column B amounts.
In column C, I need to calculate 10% of column B if the
date in Column a is between 1 April and 30 September. If
the date in column A is between 1 October and 31 March
then calculate 15%. The problem is it need to work for any
year and the date in column a will be in the format of
dd/mm/yyyy.

Your help will be much appreciated. Many Thanks in advance.
 
Hi

Into cell C2 enter the formula
=IF(AND(MONTH(A2>3,MONTH(A2<10))),0.1*B2,0.15*B2)
and copy it down
 
Samar,

Put your variable year in G1 and use this formula

=IF(AND(A1>=DATE($G$1,4,1),A1<=DATE($G$1,9,30)),B1*10%,B1*15%)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top