• Status: Solved
• Priority: Medium
• Security: Public
• Views: 244

# Formula Assistance

Hello,

I was wondering if someone can please have a look at the attached sheet and let me know if there is a better way / formula to calculate the previous year’s percentage? (Columns Q and S) I am currently having to filter by species code then by each month but I was hoping to automate it so I only have to enter the formula once and then simply drag it all the way down the page as the current way is taking far too long.

Any suggestions will be greatly appreciated!
EXAMPLE.xlsx
0
vegas86
• 2
1 Solution

Commented:
When I open your file, your formula on cell Q12 is like this:

=IF(ISERROR((P12-#REF!)/#REF!);0;(P12-#REF!)/#REF!)

???
0

Author Commented:
Hi that is because there is no previous year / moth I have started from 2006 so the very first formula will show that. If you look at the one below for 2007 you will see what it supposed to be calculating.
0

Commented:
Hello vegas*6

Note that you can do this calculation...

=(P14-P2)/P2

like this

=P14/P2-1

so if you use EDATE to get last year's date and look that up for the relevant species code then you can use this formula in Q2 copied down

=IFERROR(P2/INDEX(P\$1:P1,MATCH(1,INDEX((EDATE(G2,-12)=G\$1:G1)*(D2=D\$1:D1),0),0))-1,0)

and for S2

=IFERROR(R2/INDEX(R\$1:R1,MATCH(1,INDEX((EDATE(G2,-12)=G\$1:G1)*(D2=D\$1:D1),0),0))-1,0)

see attached

regards, barry
26902060.xlsx
0

Author Commented:
I just applied it to my sheet and it works perfectly! thank you very much Barry for your quick and flawless response!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.