# Percentage increase / Decrease

1. Novice
Windows 10 Access 2016
Join Date
Feb 2020
Posts
4

## Percentage increase / Decrease

Hi All,

I need to calculate the Percentage increase / decrease from Month to month.

The example below is for March increase/decrease from February.

If my understanding is correct to calculate the increase the formula should be:

(March2020 - February2020)/February2020 e.g. (18 - 1)/1 = 17 (1700%)

and for decrease

(March2020 - February2020)/March2020 e.g (18 - 1)/18 = -17 (-1700%)

Code:
```SELECT qry100_March2020.What, qry100_February2020.February2020, qry100_March2020.March2020,

IIf([March2020]-[February2020]<0 Or [March2020]-[February2020]>0, ([March2020]-[February2020])/[February2020], ([March2020]-[February2020])/[March2020]) AS PercChange

FROM qry100_March2020 LEFT JOIN qry100_February2020 ON qry100_March2020.What = qry100_February2020.What
ORDER BY ([March2020]-[February2020])/[February2020] DESC;```
Hope this makes sense.

Any help appreciated.

Cheers

2. What is your question? Is the output not what you expect?

Windows 8 Access 2007
Join Date
Feb 2018
Posts
62
to calculate percentage increase where the two costs are last month = A and this month = B

you want, essentially, the difference between A and B, as a percentage of A.

this gives you: (B-A)/A x 100

so your calculation is essentially correct.

however, you don't need all that IIF(A-B>0 stuff because there is the entirely wonderful absolute function: Abs(A-B) which will always give you the absolute difference between A and B.

therefore, your query can be re-written:

Code:
```SELECT qry100_March2020.What, qry100_February2020.February2020, qry100_March2020.March2020,

(ABS([March2020]-[February2020])/[February2020])*100 AS PercChange

FROM qry100_March2020 LEFT JOIN qry100_February2020 ON qry100_March2020.What = qry100_February2020.What
ORDER BY ([March2020]-[February2020])/[February2020] DESC;```

Cottonshirt

4. Novice
Windows 10 Access 2016
Join Date
Feb 2020
Posts
4
Thanks Cottonshirt,

works a treat.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Other Forums: Microsoft Office Forums - Senior Forums