You are on page 1of 13

PRACTICAL NO 1

Prepare a worksheet containing the Name and taxable income in columns A and B
respectively from rows 1 to 6, the first row contains the headings and the remaining rows
contain the data. Use your own data.
Carry out the following operations on this worksheet.
1. Obtain the income tax in column C using the following income tax slabs.
Taxable Income (Rs) Rate
First 1,00,000 Nil
Next 60,000 10%
Next 70,000 20%
Excess 30%
2. Obtain the surcharge in column D, where surcharge is 3% of the income tax for those whose
taxable income is above Rs 5,00,000
3. Obtain the total tax in column E, as the sum of income tax and surcharge.

Solution:

1. After typing in the data in columns A and B


For Income tax
1. Click at cell C1 and type the heading ‘INCOME TAX’.
2. Click at cell C2
3. Type the formula as
=IF(B2<=100000,0,
IF(B2<=160000,(B2-100000)*10%,
IF(B2<=230000, 60000*10%+(B2-160000)*20%,
60000*10%+70000*20%+(B2-230000)*30%)))
4. Click at cell C2 and drag the fill handle to C6

For Surcharge
1. Click at cell D1 and type the heading ‘SURCHARGE’
2. Click at cell D2
3. Type the formula as
=IF(B2>500000,C2*3%,0)
4. Click at cell D2 and drag the fill handle to D6
For Total Tax
1. Click at cell E1 and type the heading ‘TOTAL TAX’
2. Click at cell E2 and
3. Type the Formula as
=C2+D2 (or =SUM(C2:D2)
4. Click at cell E2 and drag the fill handle to E6
PRACTICAL NO 2

DATE AND TIME FUNCTIONS

DATE()

The DATE function returns the sequential serial number that represents a particular date. For
example, the formula =DATE(2008,7,8) returns 39637, the serial number that represents
7/8/2008.

DATEVALUE()

gives serial number for given date text. Date-text means date in quotes.

e.g =DATEVALUE(“1-JAN-1900”) GIVES 1

DAY()

Returns the day of a date, represented by a serial number. The day is given as an integer ranging
from 1 to 31.

=DAY(“25-DEC-2009”) gives 25

MONTH():-

Gives month of the year for the given serial number or date-text

e.g =MONTH(“25-dec-2009”) gives 12 (December=12) Answer

of the function is numeric.

YEAR()

Gives year of the year for the given serial number or date-text

e.g =YEAR(“25-dec-2009”) gives 2009

Answer of the function is numeric and it is always 4 digits.

WEEKDAY()

Gives day of the week for the given serial number or date-text

e.g =WEEKDAY(“03-feb-2016”) gives 4 (Wednesday=4)

DAYS360()

Gives number of days between two given dates based on an assumption that there are 360 days
in a year i.e. 12 months of 30 days.

e.g =DAYS360(“1-JAN-2020”,”1-FEB-2020”) GIVES 30


CORREL()

this function returns the correlation coefficient of the array1 and array2 cell ranges. use the
correlation coefficient to determine the relationship between two properties.

Syntax

CORREL(array1,array2)

Answer of the function is numeric

TIME()

Gives time in HH:MM AM/PM form (12 hrs.) for given time. You have to give time as per
24hrs clock with HH/MM/SS

e.g =TIME(18,30,45) gives 6:30 PM

TIMEVALUE()

This function is used to get serial number for time-text.Time-text means time in quotes.

e.g =TIMEVALUE(“6:00 PM”) gives 0.75

TODAY()

This function is used to get the current date generally date will be in American format

e.g =TODAY() gives 02/03/2016

NOW()

This function is used to get the current date as well as current time. Generally date will be in
American format and time as per 24 hrs clock.

e.g=NOW() gives 02/03/2016 18:00

TEXT FUNCTIONS LEFT()


This function is used to find the characters from the left side of the string by default it gives
one character from the left side
e.g =LEFT(“STGG COLLEGE”,4) gives STGG

RIGHT()
This function is used to find the characters from the Right side of the string by default it gives
one character from the Right side
e.g =RIGHT(“STGG COLLEGE”,4) gives LEGE

MID()
This function is used to find the character from middle of the string from mth characters and
gives n number of characters
e.g =MID(“STGG COLLEGE”,4,3) gives G C
UPPER()
This function is used to convert lowercase alphabets in to uppercase e.g
=UPPER(“STGG college”) gives STGG COLLEGE

LOWER()
This function is used to convert uppercase alphabets in to lowercase e.g
=LOWER(“STGG COLLEGE”) gives stgg college

PROPER()
It is used to capitalized the first alphabet in a text string and any other alphabet in the text that
follows any non-alphabetic character; converts all other alphabets into lowercase e.g
=PROPER(“STGG COLLEGE”) gives Stgg College

LEN()
This function is used to find length of a string e.g
=LEN(“STGG COLLEGE”) gives 12

TRIM()
This function is used to remove all the blank spaces except single blank space between two
words
e.g =TRIM(“STGG COLLEGE”) gives STGG COLLEGE

FIXED()
This function is used to round a number to the specified number of decimals, formats the
number in decimal format using a period and commas and return the result as text. By default
no. of decimals are two and no_commas is false.
=FIXED(13333.333,2) gives 13,333.33
PRACTICAL NO 3
GRADE BASIC HRA PF NET
A 1000 150 80 1070
B 4000 600 320 4280
B 5000 750 400 5350
A 3000 450 240 3210
SUMIF()
Adds all the numbers in a range for which given condition is true. If sum_range(2nd Range) is
given then values from sum_range are added otherwise values from range(1st range) are added
where the given condition is true
e.g =SUMIF(B2:B5,”>3500”,E2:E5) gives 9630

AVERAGEIF()
This function is used to find average of all the numbers in a range for which given condition is
true. If average_range(2nd Range) is given then values from average_range are considered
otherwise values from range(1st range) are considered where the given condition is true e.g
=AVERAGEIF(B2:B5,”>3500”,E2:E5) gives 4815

COUNT()
Counts the number of cells that contains numbers. Remember date and time is treated as a
number. If there is a text entry in the range or as an argument then it will not give an error e.g
=COUNT(B2:B5) gives 4

COUNTA()
Counts the number of cells that are not empty. If there is text entry in the range or as an
argument then it will not give an error e.g =COUNTA(B2:B5) gives 4

COUNTBLANK()
Counts the number of cells that are empty. If there is text entry in the range or as an argument
then it will not give an error
e.g =COUNTBLANK(B2:B5) gives 0

COUNTIF()
This function will count number of cells that are satisfying given condition e.g
=COUNTIF(B2:B5,”>1000”) gives 3

LARGE()
This function returns the kth largest value in a dataset. You can use this function to select a
value based on its relative standing. For e.g. you can use large to return the highest runner up
or 3rd place value.
e.g =LARGE(B2:B5,2) gives 4000

SMALL()
This function returns the kth smallest value in a dataset. You can use this function to select a
value based on its relative standing. For e.g. you can use small to return the lowest, 2nd lowest
or 3rd lowest value.
e.g =SMALL(B2:B5,2) gives 3000
PRACTICAL NO 4
Prepare a worksheet containing the Name of the salesman and sales for the months of January,
February and March in columns A, B, C and D respectively from rows 1 to 26, the first row
contains headings and the remaining rows contain data. Use your own data ensuring that the
sales entered in a month are minimum 100000 and maximum 300000.
Carry out the following operations on this worksheet.
1. Enter the following Bonus Table in columns H and I.
SALES BONUS
300000 2000
400000 3000
500000 4000
600000 5000
700000 6000
800000 7000
2. Obtain the total sales of each salesman in the first quarter in column E.
3. Using VLOOKUP function obtain the bonus amounts to be given to each salesman in
column F.(Note if the total sales are say 319000, which is above 300000 and below 400000
then the Bonus amount will be 2000 )

Solution:

Total Sales:
1. Click at cell E1
2. type the heading ‘Total Sales’.
3. Click at cell E2
4. Type the formula as
=SUM(B2:D2) .
5. Click at cell E2 and drag the fill handle to E26.

Bonus:
1. Click at cell F1 and type the heading ‘Bonus’.
2. Click at cell F2
3. Type the formula as
=VLOOKUP(E2,$H$2:$I$7,2)
4. Click at cell F2 and drag the fill handle to F26.
PRACTICAL NO 5
THE FOLLOWING DATA HAS BEEN ENTERED IN EXCEL WORKSHEET

NAME GENDER AGE CITY SALES


MUKUND M 25 SURAT 498000
RAVEENA F 23 NASIK 575000
SNEHA F 26 CHENAI 378000
PARVEEN M 29 NASIK 600000
VILAS M 32 KOLKATA 645000
ANIKET M 27 NAGPUR 792565

Write steps to:


1. Display only those rows where the sales are less than 400000.
2. Display only those rows where the GENDER is “M”.
3. Display only those rows where the city Name starts with “N”.

1)FILTER
1. Select the range A1:E7
2. Click at Data Tab →Filter.
3. Click at drop down of SALES
-Click at Number Filters
-Click at Less Than
-In the 2nd box type 40000
-Click at OK Button
2)FILTER
1. Select the range A1:E7 2.
Click at Data Tab →Filter.
3. Click at drop down of GENDER
-Click at TEXT Filters
-Click at Equals To
-In the 2nd box type M
-Click at OK Button.

3)FILTER
1. Select the range A1:E7
2. Click at Data Tab →Filter.
3. Click at drop down of CITY
-Click at TEXT Filters
-Click at BEGINS WITH
-In the 2nd box type NS
-Click at OK Button
PRACTICAL NO 6
The following table shows the shipment forecast of tablets, laptops and desktop PCs worldwide
for the year 2015, 2016, 2017 and 2018.

PRODUCT 2015 2016 2017 2018


DESKTOP 113.6 103.3 97.8 94.4
LAPTOPS 163.1 156.8 161.6 162.3
TABLETS 208 174.9 163.7 150.3
TOTAL

Write the steps to:


1. Find total product shipped in the year 2015,2016,2017,2018 in the cells B4, C4, D4 and
E4.
2. Create 3-D Bar chart for the above data.
3. Create a line diagram for the year 2015 and 2018.
4. create Pie chart for the year 2017

1) To find the Total Product Shipped


1. Click at cell B5.
2. Type the formula as
=SUM(B2:B4) OR =B2+B3+B4
3. Click at cell B5 and drag the fill handle up to cell E5
2) To create a Bar Chart
1. select the range A2:E4
2. Click at Insert Tab→Bar→3D
3)To create line Chart for the year 2015 and 2018
1. select the range A2:B4,E2:E4
2. Click at Insert Tab→LINE→2D

4)To Create Pie Chart for the year 2017


1. select the range A2:A4,D2:D4
2. Click at Insert Tab→Pie→2D
PRACTICAL NO 7

(Use of Label, Command Button and Properties)

i) Write a project that allows to display the label as “WELCOME TO ST. GONSALO
GARCIA COLLEGE”.
ii) change the Caption property of the label as “WELCOME TYBCOM STUDENTS”.
iii) Include at least two command buttons to

a) CHANGE – to change the caption of the label.


b) EXIT-to exits the project.

Solution 1:

Using drag drop method objects controls like label, command buttons, designing of the form is
constructed. Further the properties to these objects are set as desired in the questions.

Step 1-Following objects are created in the VB environment while designing a form.

Object Properties Set Values


FORM name frmPract1
caption Practical 1
Label Name lblWelcome
Caption Welcome to ST. GONSALO GARCIA college
Command 1 Name cmdChange
Caption &CHANGE
Command 2 Name cmdExit
Caption E&XIT

Step 2- Following code should be written in the click event of cmdChange command button
code is written in the click event of cmdChange command button

Private Sub cmdChange_Click()


lblWelcome.caption=”WELCOME TYBCOM STUDENTS”
End Sub
____________________________________
Private Sub cmdExit_Click()
End
End Sub
PRACTICAL NO 8
Write an application with the following specifications:
A single text box to enter the text.
Three check boxes for Bold, Italics and Underlining the text in the text box as selected.
Three option buttons for Red, Green and Blue color of the text in the text box as selected.
A Command button to exit the application.

Step 1-Following objects are created in the VB environment while designing a form

Object Properties Set Values


Form Name Frmform1
Caption Practical no 7
Text 1 Name txtDisplay
Text (Blank )
Check box 1 Name chkBold
Caption BOLD
Check box 2 Name chkItalic
Caption ITALIC
Check box 3 Name chkUnderline
Caption UNDERLINE
Option button 1 Name optRed
Caption RED
Option Button 2 Name optGreen
Caption GREEN
Option button 3 Name optBlue
Caption BLUE
Command 1 name cmdExit
caption E&XIT

Step 2- Following code should be written in the click event


Private Sub cmdExit_Click()
End
End Sub
If You are using VB in Excel
Private Sub chkBold_Click()
Private Sub chkBold_Click()
If chkBold.Value = True Then
If chkBold.Value = 1 Then
txtDisplay.Font.Bold = True
txtDisplay.FontBold = True
Else
Else
txtDisplay.FontBold = False txtDisplay.Font.Bold = False
End If End If
End Sub End Sub

Private Sub chkItalic_Click() Private Sub chkItalic_Click()


If chkItalic.Value = 1 Then If chkItalic.Value = True Then
txtDisplay.FontItalic = True txtDisplay.Font.Italic = True
Else Else
txtDisplay.FontItalic = False txtDisplay.Font.Italic = False
End If End If
End Sub End Sub
Private Sub chkUnderline_Click() Private Sub chkUderline_Click()
If chkUnderline.Value = 1 Then If chkUnderline.Value = True
txtDisplay.FontUnderline = True Then
Else txtDisplay.Font.Underline = True
txtDisplay.FontUnderline = False Else
End If txtDisplay.Font.Underline = False
End Sub End If

Private Sub optBlue_Click()


txtDisplay.ForeColor = vbBlue
End Sub

Private Sub optRed_Click()


txtDisplay.ForeColor = vbRed
End Sub

Private Sub optGreen_Click()


txtDisplay.ForeColor = vbGreen
End Sub
PRACTICAL 9

Write a VB project to Calculate Simple Interest and Compound Interest

Step 1-Following objects are created in the VB environment while designing a form
Object Properties Set Values
Form Name frmSimpleCompound
Caption Simple and Compound
Label 1 Name lblAmt
Caption AMOUNT
Label 2 Name lblYrs
Caption YEARS
Label 3 Name lblRate
Caption RATE
Label 4 Name lblInt
Caption INTEREST
Text box 1 Name txtAmt
Text (Blank )
Text box 2 Name txtYrs
Text (Blank )
Text box 3 Name txtRate
Text (Blank )
Text box 4 Name txtInt
Text (Blank )
Command 1 Name cmdSimple
Caption &Simple
Command 2 Name cmdCompound
Caption &Compound
Command 3 Name cmdClear
Caption C&lr
Command 4 Name cmdExit
Caption E&xit

Step 2- Following code should be written in the click event

Private Sub cmdSimple_Click()


txtInt=(val(txtAmt)*val(txtYrs)*val(txtRate))/100
End Sub
Private Sub cmdCompound_Click()
txtInt=val(txtAmt)*(1+val(txtRate)/100)^val(txtYrs)-val(txtAmt)
End Sub
Private Sub cmdClear_Click()
txtAmt=”” txtYrs=”” txtRate=”” txtInt=”” txtAmt.setFocus
End Sub
Private sub cmdExit_Click()
End
End Sub
PRACTICAL NO:-10

Write VB project to design a suitable form which allows the user to enter an integer.
Calculate and display the factorial of that integer when the calculate button is clicked.

Steps 1-Following objects are created in the VB environment while designing a form
Object Properties SetValues
Form Name frmFact
Caption Factorial
Label1 Name lblInt
Caption INTEGER
Label2 Name lblFact
caption FACTORIAL
Text1 Name txtInt
text (Blank )
Text2 Name txtFact
Text (Blank )
Locked True
Command1 Name cmdFind
caption &FIND
Command2 name cmdClear
Caption C&LEAR
Command3 Name cmdExit
Caption E&XIT

Step 2- Following code should be written in the click event


Private Sub cmdCalc_Click()
Dim I As Integer
txtFact=1
for I=1 To Val(txtInt)
txtFact=Val(txtFact)*I
Next I
End Sub

Private sub cmdClear_Click()


txtInt=””
txtFact=””
txtInt.SetFocus
End Sub

Private Sub cmdExit_Click()


End
End Sub

Kiran Digitally signed by


Kiran Barot

Barot Date: 2023.01.10


11:44:02 +05'30'

You might also like