Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Excel / June 2006



Tip: Looking for answers? Try searching our database.

Function to give previous month

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay - 24 Jun 2006 18:34 GMT
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-
Bob Greenblatt - 26 Jun 2006 13:41 GMT
On 6/24/06 1:34 PM, in article C0C33635.3395%zeugma@toucanspam.com, "Jay"
<zeugma@toucanspam.com> wrote:

> 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
[quoted text clipped - 30 lines]
>
> -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

Signature

Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.