0% found this document useful (0 votes)
133 views8 pages

Solutions PDF

The document provides instructions for several tasks in Excel: 1. Hiding the formula bar in Excel 2007. 2. Creating a VBA function to convert currency values to Indian rupees. 3. Ensuring proper number formatting when using mail merge from Excel data. 4. Descriptions and examples of financial functions like PMT, PPMT, and IPMT to calculate loan payments and interest amounts.

Uploaded by

ali_zulfikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views8 pages

Solutions PDF

The document provides instructions for several tasks in Excel: 1. Hiding the formula bar in Excel 2007. 2. Creating a VBA function to convert currency values to Indian rupees. 3. Ensuring proper number formatting when using mail merge from Excel data. 4. Descriptions and examples of financial functions like PMT, PPMT, and IPMT to calculate loan payments and interest amounts.

Uploaded by

ali_zulfikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1.

Hiding formula bar in Excel 2007:


View Tab Show/Hide Command Group uncheck formula bar button
2. Converting Currency in Rupees Function:
Developer Tab Code Group Visual Basic Command Button Insert Menu
Module and paste following code in module window.
Function ConvertCurrencyToRupees(ByVal MyNumber)
Dim Temp
Dim Rupees, Paise
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' Convert MyNumber to a string, trimming extra spaces.
MyNumber = Trim(Str(MyNumber))
' Find decimal place.
DecimalPlace = InStr(MyNumber, ".")
' If we find decimal place...
If DecimalPlace > 0 Then
' Convert Paise
Temp = Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2)
Paise = ConvertTens(Temp)
' Strip off Paise from remainder to convert.
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
' Convert last 3 digits of MyNumber to English Rupees.
Temp = ConvertHundreds(Right(MyNumber, 3))
If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
' Remove last 3 converted digits from MyNumber.
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1

Loop
' Clean up Rupees.
Select Case Rupees
Case ""
Rupees = "No Rupees"
Case "One"
Rupees = "One Rupee"
Case Else
Rupees = Rupees & " Rupees"
End Select
' Clean up Paise.
Select Case Paise
Case ""
Paise = " And No Paise"
Case "One"
Paise = " And One Paisa"
Case Else
Paise = " And " & Paise & " Paise"
End Select
ConvertCurrencyToRupees = Rupees & Paise
End Function
Private Function ConvertHundreds(ByVal MyNumber)
Dim Result As String
' Exit if there is nothing to convert.
If Val(MyNumber) = 0 Then Exit Function
' Append leading zeros to number.
MyNumber = Right("000" & MyNumber, 3)
' Do we have a hundreds place digit to convert?
If Left(MyNumber, 1) <> "0" Then
Result = ConvertDigit(Left(MyNumber, 1)) & " Hundred "
End If
' Do we have a tens place digit to convert?
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & ConvertTens(Mid(MyNumber, 2))
Else
' If not, then convert the ones place digit.
Result = Result & ConvertDigit(Mid(MyNumber, 3))
End If

ConvertHundreds = Trim(Result)
End Function
Private Function ConvertTens(ByVal MyTens)
Dim Result As String
' Is value between 10 and 19?
If Val(Left(MyTens, 1)) = 1 Then
Select Case Val(MyTens)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else
' .. otherwise it's between 20 and 99.
Select Case Val(Left(MyTens, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
' Convert ones place digit.
Result = Result & ConvertDigit(Right(MyTens, 1))
End If
ConvertTens = Result
End Function
Private Function ConvertDigit(ByVal MyDigit)
Select Case Val(MyDigit)
Case 1: ConvertDigit = "One"

Case 2: ConvertDigit = "Two"


Case 3: ConvertDigit = "Three"
Case 4: ConvertDigit = "Four"
Case 5: ConvertDigit = "Five"
Case 6: ConvertDigit = "Six"
Case 7: ConvertDigit = "Seven"
Case 8: ConvertDigit = "Eight"
Case 9: ConvertDigit = "Nine"
Case Else: ConvertDigit = ""
End Select
End Function
3. Number Format in Mail Merge:
Follow the Normal Mail Merge Process, Select Excel file in data source. Please note
following facts.
Numbers in 1200.00 is truncated to 1200 format
Numbers in 1200.45 remain same
Numbers in 1,200.12 is converted to 120012
4. Using PMT, IPMT, PPMT functions:
PMT: used to calculate EMI
PPMT : used to calculate Principal Part of EMI
IPMT : used to calculate Interest part if the EMI

PMT(rate,nper,pv,fv,type)

For a more complete description of the arguments in PMT, see the PV function.

Rate is the interest rate for the loan.

Nper is the total number of payments for the loan.

Pv is the present value, or the total amount that a series of future payments is worth now; also
known as the principal.

Fv is the future value, or a cash balance you want to attain after the last payment is made. If fv is
omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.

Type is the number 0 (zero) or 1 and indicates when payments are due.

Data

Description

8%

Annual interest rate

10

Number of months of payments

10000

Amount of loan

Formula

Description (Result)

=PMT(A2/12, A3, A4)

Monthly payment for a loan with the above terms (-1,037.03)

=PMT(A2/12, A3, A4,


0, 1)

Monthly payment for a loan with the above terms, except payments are due at the
beginning of the period (-1,030.16)

PPMT
Returns the payment on the principal for a given period for an investment based on periodic,
constant payments and a constant interest rate.

Syntax

PPMT(rate,per,nper,pv,fv,type)

For a more complete description of the arguments in PPMT, see PV.

Rate is the interest rate per period.

Per specifies the period and must be in the range 1 to nper.

Nper is the total number of payment periods in an annuity.

Pv is the present value the total amount that a series of future payments is worth now.

Fv is the future value, or a cash balance you want to attain after the last payment is made. If fv is
omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.

Type is the number 0 or 1 and indicates when payments are due.

Set type equal to

If payments are due

0 or omitted

At the end of the period

At the beginning of the period

Remark

Make sure that you are consistent about the units you use for specifying rate and nper. If you make
monthly payments on a four-year loan at 12 percent annual interest, use 12%/12 for rate and 4*12
for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper.

Example 1

Data

Description (Result)

10%

Annual interest rate

Number of years in the loan

2000

Amount of loan

Formula

Description (Result)

=PPMT(A2/12, 1, A3*12, A4)

Payment on principle for the first month of loan (-75.62)

NOTE

The interest rate is divided by 12 to get a monthly rate. The number of years the money is

paid out is multiplied by 12 to get the number of payments.

IPMT
Returns the interest payment for a given period for an investment based on periodic, constant
payments and a constant interest rate.

Syntax

IPMT(rate,per,nper,pv,fv,type)

Rate is the interest rate per period.

Per is the period for which you want to find the interest and must be in the range 1 to nper.

Nper is the total number of payment periods in an annuity.

Pv is the present value, or the lump-sum amount that a series of future payments is worth right
now.

Fv is the future value, or a cash balance you want to attain after the last payment is made. If fv is
omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).

Type is the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed
to be 0.
Set type equal to

If payments are due

At the end of the period

At the beginning of the period

Remarks

Make sure that you are consistent about the units you use for specifying rate and nper.
If you make monthly payments on a four-year loan at 12 percent annual interest, use 12%/12
for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate
and 4 for nper.

For all the arguments, cash you pay out, such as deposits to savings, is represented by
negative numbers; cash you receive, such as dividend checks, is represented by positive
numbers.

Example

The example may be easier to understand if you copy it to a blank worksheet.

Data

Description

10%

Annual interest

Period for which you want to find the interest

Years of loan

8000

Present value of loan

Formula

Description (Result)

=IPMT(A2/12, A3*3, A4,


A5)

Interest due in the first month for a loan with the terms above (-22.41)

=IPMT(A2, 3, A4, A5)

Interest due in the last year for a loan with the terms above, where payments
are made yearly (-292.45)

Note The interest rate is divided by 12 to get a monthly rate. The years the money is paid out is
multiplied by 12 to get the number of payments.

1. Concatenating qualifications:
Function QfyConcat(x As Range, y As Range) As String
Dim vstr1 As String
Dim vstr2 As String
a=3
vstr1 = y.Value
For Each rw In x.Rows
If vstr1 = x.Cells(a) Then
vstr2 = (vstr2) & (x.Cells(a + 1) & IIf(vstr1 = x.Cells(a + 2), ", ", ""))
End If
a=a+2
Next rw
QfyConcat= vstr2
End Function

You might also like