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

Advanced Excel Problems With Solutions

Advance Excel formula

Uploaded by

gta140519
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)
132 views8 pages

Advanced Excel Problems With Solutions

Advance Excel formula

Uploaded by

gta140519
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

Page |1

In this PDF file, you will get 10 advanced exercises to test your Excel prowess. You can download
the Excel file from the download section of this article. You will need to know how to separate
names, generate random numbers, calculate distance between addresses, insert pictures from
URLs, create dependent dropdown lists, find duplicate rows, combine duplicate rows, unhide
rows in a range, transpose rows to columns, and create a meter chart. Except for problem 07,
all problems can be solved using Excel 2010 or later. You will need Microsoft 365 to solve Exercise
07.
• Problem 01 Separate First, Middle, and Last Name: You need to split the first, middle,
and last name from the full name using a formula.
• Firstly, you will need to use the LEFT, SEARCH, MID, RIGHT, LEN, SUBSTITUTE, and
FIND functions to solve this problem.

• Solution 01:
o To find the First Name, =LEFT(B7,SEARCH(" ",B7)-1)
o Middle Name =MID(B7,SEARCH(" ",B7)+1,SEARCH(" ",B7,SEARCH(" ",B7)+1)-
(SEARCH(" ",B7)+1))
o Last Name =RIGHT(B7,LEN(B7)-FIND("^",SUBSTITUTE(B7," ","^",LEN(B7)-
LEN(SUBSTITUTE(B7," ","")))))

• Problem 02 Generate Random Number from Range:


o Secondly, you will type a VBA code to return random numbers that have the
lowest value 50, highest value 90.
• Solutions 02:
o Use this VBA Code

Sub Random_Number_Generator()
Dim r, c As Integer
For r = 18 To 23
For c = 3 To 5
Cells(r, c).Value = Int((90 - 50 + 1) * Rnd + 50)
Next c
Next r
End Sub

• Problem 03 Find Distance Between Two Addresses:


o The coordinates between two addresses are known. You will use the Haversine
formula to find the distance.
• Solution 03:
o =2*6400*ASIN(SQRT((SIN(C29-C28)/2)^2+COS(C28)*COS(C29)*(SIN(D29-
D28)/2)^2))

• Problem 04 Insert Picture from URL:


o Fourthly, you will insert an image as a shape in a cell from a URL using VBA.

• Solution 04:
o Use this VBA code
Sub URLPhotoInsert()
Dim cPhoto As String
Dim cPicture As Shape
Dim cRange As Range
Dim cItem As Range
Set cRange = Range("D36:D38")
For Each cItem In cRange
cPhoto = cItem.Offset(0, -1)
If cPhoto = "" Then GoTo line33
Set cPicture = ActiveSheet.Shapes.AddPicture(cPhoto, _
msoFalse, msoTrue, Columns(cItem.Column).Left, _
Rows(cItem.Row).Top, -1, -1)
If cPicture.Width > cItem.Width Then cPicture.Width = cItem.Width
If cPicture.Height > cItem.Height Then cPicture.Height = cItem.Height
With cPicture
.Top = Rows(cItem.Row).Top + (Rows(cItem.Row).Height - .Height) / 2
.Left = Columns(cItem.Column).Left + (.TopLeftCell.Width - .Width) / 2
.LockAspectRatio = msoTrue
.Placement = xlMoveAndSize
End With
line33:
cPhoto = ""
Next
End Sub

• Problem 05 Create Dependent Dropdown List:


o Then, your task is to create a dependent data validation list using the INDIRECT
function and Named Range.

• Solution 05:
o Firstly, apply Named Range. Additional data are given in the “Reference Tables”
sheet. Then, use the Data Validation feature to finish the task.
• Problem 06 Find Duplicate Rows:
o Afterward, you will highlight the duplicate rows in a range using VBA.

• Solution 06:
o Apply this VBA code
Sub DuplicateRows()
Dim cRow As Integer, i As Integer
For i = 49 To 56
For cRow = i + 1 To 56
If Range("B" & cRow) = Range("B" & i) Then
If Range("C" & cRow) = Range("C" & i) Then
If Range("D" & cRow) = Range("D" & i) Then
Range("B" & cRow & ":D" & cRow).Interior.Color = vbGreen
Range("B" & i & ":D" & i).Interior.Color = vbGreen
End If
End If
End If
Next cRow
Next i
End Sub

• Problem 07 Combine Duplicate Rows without Losing Data:


o Then, your task is to combine duplicate rows using the UNIQUE, and TEXTJOIN
functions with a comma. You will need Microsoft 365 to solve this.

• Solution 07:
o Use this formula to find unique names =UNIQUE(B61:B66)
o Use this formula to find unique car maker =TEXTJOIN(",
",TRUE,UNIQUE(IF($B$61:$B$66=$B69,$C$61:$C$66,"")))
o Finally, insert this formula to combine the car model =TEXTJOIN(",
",TRUE,UNIQUE(IF($B$61:$B$66=$B69,$D$61:$D$66,"")))

• Problem 08 Unhide Rows Within Range:


o After that, you will reveal the hidden rows with a specified range using VBA.

• Solution 08:
o Apply this VBA code

Sub UnhideRowsFromRange()
For k = 77 To 84
Rows(k).Hidden = False
Next k
End Sub

• Problem 09 Transpose Rows to Columns Using Power Query:


o Then, your objective is to transpose rows to columns by applying the Power
Query.
• Solution 09:
o Follow this article transpose rows to columns.

• Problem 10 Create Meter Chart:


o Finally, the exercise 10 is to prepare a meter chart in Excel using the known data
points.

• Solution 10:
o Follow this article to know how to create a meter chart.

If you have any confusion, please check the Excel file for this article. Moreover, you are free to
comment in our website for further assistance.

You might also like