Tuesday, April 12, 2016

PROPER , UPPER and LOWER function in Excel

For text formatting in excel we can use PROPER , UPPER and LOWER function .

PROPER function – capitalizes the first letter in each word.

UPPER function – changes text to all uppercase.

LOWER function – changes text to all lowercase.


Example: LOWER function – changes text to all lowercase.



Example: PROPER function – capitalizes the first letter in each word.






Example: UPPER function – changes text to all uppercase.







Tuesday, March 29, 2016

How to calculate Retirement Date in Excel

For Central Govt Employees for whom retirement is 60 years then Retirement Date can be calculated using formula in excel

=IF(DAY(A1)=1,EOMONTH(A1,719),EOMONTH(A1,720))





For State Govt Employees for whom retirement is 58 years then Retirement Date can be calculated using formula in Excel

=IF(DAY(A1)=1,EOMONTH(A1,695),EOMONTH(A1,696))


How to calculate retirement day in Excel

There are different ways : You can write macro (VBA script).

Assumption : Retirement Date is 60 Years after Birth.


Function MYDATE2(pDate As Date)
'Update 20150310
Dim rng As Range
Dim xResult As Date

Dim xDay As Integer
Dim xMonth As Integer
Dim xYear As Integer

Dim LDate As Date

xDay = Day(pDate)
xMonth = Month(pDate)
xYear = Year(pDate)

If xDay = 1 Then xMonth = xMonth - 1

LDate = DateSerial(xYear + 60, xMonth, xDay)



MYDATE2 = LastDayInMonth(LDate)
End Function


======Second Function=======


Function LastDayInMonth(Optional pDate As Date = 0) As Date
'Updateby20140723
If pDate = 0 Then pDate = VBA.Date
LastDayInMonth = VBA.DateSerial(VBA.Year(pDate), VBA.Month(pDate) + 1, 0)
End Function

========================================================================