Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ronni T. Vasquez M.
 
Posts: n/a
Default I'm Having Problems with EOMONTH

Hi Everyone,

I'm creating for a company, a daily report using excel. This report is going
to be use by clients with differents language version of Excel (Spanish,
English) or differents language version of Windows.

Functions like: TODAY or NOW, works perfectly no matter what language
version of excel i'm working with. It's seems that Excel recognize the
function in the sheet and automatically convert that function to the local
language version of excel (or Windows).

However, EOMONTH (another functions i'm dealing with) doesn't works when i
try to open the report in a spanish version of Excel.

If I change the function to FIN.MES (spanish version of EOMONTH) to solve
the problem, it works perfectly, but when I try to open the report in an
english version of excel again, the function doesn't works.

It seems that excel doesn't recognize the language of this functions.

Can anyone of you help me with this?

In Both versions, I have checked the Analisys ToolPak Excel Add-in Option.

Regards,
--
Ronni T. Vasquez M.


  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

See one answer in your "5/22/05" post.

In article ,
"Ronni T. Vasquez M." wrote:

Hi Everyone,

I'm creating for a company, a daily report using excel. This report is going
to be use by clients with differents language version of Excel (Spanish,
English) or differents language version of Windows.

Functions like: TODAY or NOW, works perfectly no matter what language
version of excel i'm working with. It's seems that Excel recognize the
function in the sheet and automatically convert that function to the local
language version of excel (or Windows).

However, EOMONTH (another functions i'm dealing with) doesn't works when i
try to open the report in a spanish version of Excel.

If I change the function to FIN.MES (spanish version of EOMONTH) to solve
the problem, it works perfectly, but when I try to open the report in an
english version of excel again, the function doesn't works.

It seems that excel doesn't recognize the language of this functions.

Can anyone of you help me with this?

In Both versions, I have checked the Analisys ToolPak Excel Add-in Option.

Regards,

  #3   Report Post  
arno
 
Posts: n/a
Default

Hi Ronni,

However, EOMONTH (another functions i'm dealing with) doesn't works
when i try to open the report in a spanish version of Excel.


sorry, I cannot solve your problem. However, as a workaround you can
use a formula to replace eomonth like

=date(year, month+1, 0)

this will give you day zero of the next month which is one day before
the first day of the next month which is the last day of the current
month. Eg. if you want to know the last day of october (the second next
end of month from today, uaaaahhh..... bad english) you would use
instead of

=eomonth(today(),2)

this formula:
=date(year(today()),month(today())+3,0)

confusing enough?

arno

  #4   Report Post  
Blue Hornet
 
Posts: n/a
Default

Ronni,

I had a similar problem with EOMONTH not being able to compute in the
SAME spreadsheet on the SAME computer with the SAME version of Excel.
In other words, from time to time it would just fail to compute,
leaving me with a NAME? error--and I always have the Analysis TookPak
add-in active. I didn't get it, and it was driving me crazy.

So I wrote my own function and it seems to work okay. I haven't had
occasion to check its performance on other language versions, though.
Of course, it means the sheet has to be opened with "Macros Enabled",
but all of mine require that.

*************************************

Function myEOM(Target As Date, AddMonths As Integer) As Date
' Because the EOMONTH() function in the Analysis Toolpack is causing
grief
myYear = Year(Target)
myMonth = Month(Target)
myTotalMonths = ((myYear - 1900) * 12) + myMonth + AddMonths + 1

myYear = Int(myTotalMonths / 12) + 1900
If myTotalMonths Mod 12 < 0 Then
myMonth = myTotalMonths Mod 12
Else
myMonth = 12 'Months evenly divisible by 12 means = December
myYear = Year(Target)
End If

myEOM = DateValue(myMonth & "/1/" & myYear) - 1
End Function

  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

While you can use worksheet functions (see my other reply), which in
general are more efficient, you could make your UDF a bit more efficient
using the DateSerial method.

This routine also corrects the result if the 1904 date system is being
used:

Public Function myEOM(BaseDate As Date, AddMonths As Long) As Date
Dim dDateCorrection As Double
With Application
If TypeOf .Caller Is Range Then _
dDateCorrection = 1462 * .Caller.Parent.Parent.Date1904
End With
myEOM = DateSerial(Year(BaseDate), Month(BaseDate) + _
AddMonths + 1, 0) + dDateCorrection
End Function


In article .com,
"Blue Hornet" wrote:

Ronni,

I had a similar problem with EOMONTH not being able to compute in the
SAME spreadsheet on the SAME computer with the SAME version of Excel.
In other words, from time to time it would just fail to compute,
leaving me with a NAME? error--and I always have the Analysis TookPak
add-in active. I didn't get it, and it was driving me crazy.

So I wrote my own function and it seems to work okay. I haven't had
occasion to check its performance on other language versions, though.
Of course, it means the sheet has to be opened with "Macros Enabled",
but all of mine require that.

*************************************

Function myEOM(Target As Date, AddMonths As Integer) As Date
' Because the EOMONTH() function in the Analysis Toolpack is causing
grief
myYear = Year(Target)
myMonth = Month(Target)
myTotalMonths = ((myYear - 1900) * 12) + myMonth + AddMonths + 1

myYear = Int(myTotalMonths / 12) + 1900
If myTotalMonths Mod 12 < 0 Then
myMonth = myTotalMonths Mod 12
Else
myMonth = 12 'Months evenly divisible by 12 means = December
myYear = Year(Target)
End If

myEOM = DateValue(myMonth & "/1/" & myYear) - 1
End Function



  #6   Report Post  
Ronni T. Vasquez M.
 
Posts: n/a
Default

Hi,

Thanks for your help, JE McGimpsey and you have given me the same solution,
it works and I'm going to use it as you both show me.

However I'll keep reading about these subject to learn more.

If I found something else, i'll put it in this forum.

Regards

--
Ronni T. Vasquez M.

"arno" wrote in message
...
Hi Ronni,

However, EOMONTH (another functions i'm dealing with) doesn't works
when i try to open the report in a spanish version of Excel.


sorry, I cannot solve your problem. However, as a workaround you can
use a formula to replace eomonth like

=date(year, month+1, 0)

this will give you day zero of the next month which is one day before
the first day of the next month which is the last day of the current
month. Eg. if you want to know the last day of october (the second next
end of month from today, uaaaahhh..... bad english) you would use
instead of

=eomonth(today(),2)

this formula:
=date(year(today()),month(today())+3,0)

confusing enough?

arno



  #7   Report Post  
Ronni T. Vasquez M.
 
Posts: n/a
Default

Hi Blue,

Thank for your help,

I'm going to use your function in a spanish version and i'll let you know
what happen with it...

After reading it, i think it should work...

Regards,
--
Ronni T. Vasquez M.

"Blue Hornet" wrote in message
oups.com...
Ronni,

I had a similar problem with EOMONTH not being able to compute in the
SAME spreadsheet on the SAME computer with the SAME version of Excel.
In other words, from time to time it would just fail to compute,
leaving me with a NAME? error--and I always have the Analysis TookPak
add-in active. I didn't get it, and it was driving me crazy.

So I wrote my own function and it seems to work okay. I haven't had
occasion to check its performance on other language versions, though.
Of course, it means the sheet has to be opened with "Macros Enabled",
but all of mine require that.

*************************************

Function myEOM(Target As Date, AddMonths As Integer) As Date
' Because the EOMONTH() function in the Analysis Toolpack is causing
grief
myYear = Year(Target)
myMonth = Month(Target)
myTotalMonths = ((myYear - 1900) * 12) + myMonth + AddMonths + 1

myYear = Int(myTotalMonths / 12) + 1900
If myTotalMonths Mod 12 < 0 Then
myMonth = myTotalMonths Mod 12
Else
myMonth = 12 'Months evenly divisible by 12 means = December
myYear = Year(Target)
End If

myEOM = DateValue(myMonth & "/1/" & myYear) - 1
End Function



  #8   Report Post  
Ronni T. Vasquez M.
 
Posts: n/a
Default

Hi JE McGimpsey,

Thanks for your comments, this solutions is a little more difficult to
understand so i have nothing to say about the solution itself until I read a
little bit more about excel programing object. I enjoy learning these kind
of things, so thanks for helping us with this...

I'll read carefully this solutions,

Regards
--
Ronni T. Vasquez M.

"JE McGimpsey" wrote in message
...
While you can use worksheet functions (see my other reply), which in
general are more efficient, you could make your UDF a bit more efficient
using the DateSerial method.

This routine also corrects the result if the 1904 date system is being
used:

Public Function myEOM(BaseDate As Date, AddMonths As Long) As Date
Dim dDateCorrection As Double
With Application
If TypeOf .Caller Is Range Then _
dDateCorrection = 1462 * .Caller.Parent.Parent.Date1904
End With
myEOM = DateSerial(Year(BaseDate), Month(BaseDate) + _
AddMonths + 1, 0) + dDateCorrection
End Function


In article .com,
"Blue Hornet" wrote:

Ronni,

I had a similar problem with EOMONTH not being able to compute in the
SAME spreadsheet on the SAME computer with the SAME version of Excel.
In other words, from time to time it would just fail to compute,
leaving me with a NAME? error--and I always have the Analysis TookPak
add-in active. I didn't get it, and it was driving me crazy.

So I wrote my own function and it seems to work okay. I haven't had
occasion to check its performance on other language versions, though.
Of course, it means the sheet has to be opened with "Macros Enabled",
but all of mine require that.

*************************************

Function myEOM(Target As Date, AddMonths As Integer) As Date
' Because the EOMONTH() function in the Analysis Toolpack is causing
grief
myYear = Year(Target)
myMonth = Month(Target)
myTotalMonths = ((myYear - 1900) * 12) + myMonth + AddMonths + 1

myYear = Int(myTotalMonths / 12) + 1900
If myTotalMonths Mod 12 < 0 Then
myMonth = myTotalMonths Mod 12
Else
myMonth = 12 'Months evenly divisible by 12 means = December
myYear = Year(Target)
End If

myEOM = DateValue(myMonth & "/1/" & myYear) - 1
End Function



  #9   Report Post  
Blue Hornet
 
Posts: n/a
Default

Actually ... now that I understand JEM's worksheet function (I haven't
worked with the "day 0" concept before), I'd be inclined to try his
method.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm having problems with EOMONTH Ronni T. Vasquez M. Excel Worksheet Functions 2 August 22nd 05 04:42 PM
Excel Analysis Add-in EOMONTH generates #NAME? error Ray Excel Worksheet Functions 6 July 18th 05 07:00 PM
problems with Sharing excel files mmayfield Excel Discussion (Misc queries) 0 January 22nd 05 08:45 PM
Problems opening Excel files using DFS links Byron Excel Discussion (Misc queries) 2 January 1st 05 11:31 PM
Problems with Excel formulas when 2002 upgraded to XP Kathi McGraw Excel Worksheet Functions 0 November 16th 04 05:27 PM


All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"