Function to give previous month

J

Jay

What function/formula can I use to return the previous month. Let's say cell
A1 contains the word August. What can I put in the next cell to return
July. But will also give December if January is in A1. I am currently doing
it with the following convoluted vlookup & I'm sure there must be an easier
way.

ColG ColH ColI

12 December 12
11 November 11
10 October 10
9 September 9
8 August 8
7 July 7
6 June 6
5 May 5
4 April 4
3 March 3
2 February 2
1 January 1
0 December 0
-1 November -1
-2 October -2

Above is my vlookup range (columns G,H,I rows 3 to 17) and my formula is:

=VLOOKUP((VLOOKUP(A1,$H$3:$I$17,2,FALSE)-1),$G$3:$H$17,2,FALSE)

It works fine but I know I must be missing something *really* obvious.(and
simpler:)

Many thanks

-Jay-
 
B

Bob Greenblatt

What function/formula can I use to return the previous month. Let's say cell
A1 contains the word August. What can I put in the next cell to return
July. But will also give December if January is in A1. I am currently doing
it with the following convoluted vlookup & I'm sure there must be an easier
way.

ColG ColH ColI

12 December 12
11 November 11
10 October 10
9 September 9
8 August 8
7 July 7
6 June 6
5 May 5
4 April 4
3 March 3
2 February 2
1 January 1
0 December 0
-1 November -1
-2 October -2

Above is my vlookup range (columns G,H,I rows 3 to 17) and my formula is:

=VLOOKUP((VLOOKUP(A1,$H$3:$I$17,2,FALSE)-1),$G$3:$H$17,2,FALSE)

It works fine but I know I must be missing something *really* obvious.(and
simpler:)

Many thanks

-Jay-
If your dates are really text, then your method is about as good as any.
However, if the dates are really an Excel date, but formatted to show the
month. Then you can simply use =month(a1)-1
 

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