0% found this document useful (0 votes)
45 views

Excel Interview Questions - Advanced

This document discusses various advanced Excel interview questions and answers. It covers topics like What-If Analysis, the difference between functions and subroutines in VBA, finding the last row and column, checking if a file exists, debugging VBA code, and more.

Uploaded by

st_kannan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Excel Interview Questions - Advanced

This document discusses various advanced Excel interview questions and answers. It covers topics like What-If Analysis, the difference between functions and subroutines in VBA, finding the last row and column, checking if a file exists, debugging VBA code, and more.

Uploaded by

st_kannan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

1

https://www.simplilearn.com/tutorials/excel-tutorial/excel-interview-questions

Advanced Level Excel Interview Questions

41. What is the What-If Analysis in Excel?


The What-If Analysis in Excel is a powerful tool to perform complex mathematical calculations,
experiment with data, and try out different scenarios.
Consider the following example:
If you get $10,000 worth of sales over the next few months, how much profit can you expect?”

Such scenarios can be solved using the What-If Analysis.


Go to the Data tab and click on What-If Analysis present under Forecast.
Scenario Manager is used for a comparison of different scenarios.
The Goal Seek performs reverse calculations.
The Data Table is used for sensitivity analysis.
To learn more about how What-If analysis works, click on this link: “IQ video link”

42. What is the difference between a function and a subroutine in VBA?


2

43. What is the difference between ThisWorkbook and ActiveWorkbook in VBA?


3

44. How will you pass arguments to VBA Function?


Arguments can be passed to a VBA function as a reference or as a value.
Below is an example to illustrate both the usages.
Dim x As Integer
x = 10
MsgBox Triple(x)
MsgBox x

If you run the cells by passing the values as a reference, it will display 40 both the times. When we
pass arguments by reference, we are referencing the original value. The original value of x is
changed in the function.
When we pass the arguments by value, we are passing a copy to the function. The original value is
not changed. Hence, the second MsgBox will display the original value 10.

45. How do you find the last row and column in VBA?
To find the last row, use the below lines code in the VBA module:
Sub FindingLastRow()
Dim lastRow As Long
lastRow = ActiveSheet.Cells.SpecialCells(xlLastCell).Row
MsgBox (lastRow)
End Sub
To find the last column, use the below lines code in the VBA module:
Sub FindingLastColumn()
Dim lastRow As Long
4

lastColumn = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
MsgBox (lastColumn)
End Sub

46. How do we check whether a file exists or not in a specified location?


Sub CheckFileExists()

Dim strFileName As String


Dim strFileExists As String

strFileName = “File location\file_name.xlsx”


strFileExists = Dir(strFileName)

If strFileExists = “” Then
MsgBox “The selected file doesn't exist”
Else
MsgBox “The selected file exists”
End If

End Sub
47. Explain how to debug a VBA code?
To debug a VBA code line by line, you can use the F8 key. You can also create a breakpoint to
terminate the execution wherever you want.
The execution will start from the beginning of the code, and every time you press F8, it will execute
the next line and continue until the end of the code. The yellow arrow and the highlighted line tells
you the current point to execution.

48. Write a VBA function to calculate the area of a rectangle.


Function Area(Length As Double, Optional Width As Variant)
If IsMissing(Width) Then
Area = Length * Length
Else
Area = Length * Width
End If
End Function
49. Write a VBA function to check if a number is a prime number or not.
Sub Prime()
Dim divisors As Integer, number As Long, i As Long
divisors = 0
number = InputBox(“Enter a number”)
For i = 1 To number
If number Mod i = 0 Then
5

divisors = divisors + 1
End If
Next i
If divisors = 2 Then
MsgBox number & “ is a prime number”
Else
MsgBox number & “ is not a prime number”
End If
End Sub
50. Write a VBA code to create a bar chart with the given data.
Consider the below data that has two features. You can use the lines of code below to create a bar
chart.

20. What's the benefit of using INDEX-MATCH instead of VLOOKUP?

Using INDEX-MATCH in Excel instead of VLOOKUP offers several advantages: it


provides greater flexibility, as it can return a value in a column to the left of the lookup
column, unlike VLOOKUP, which only works left-to-right. INDEX-MATCH is also more
efficient in processing, especially for large datasets, as it only looks at specific columns rather
than the entire row. It's less prone to errors when columns are added or deleted,
since INDEX-MATCH uses column references that don't change with column modifications.
6

21. How do you create a drop-down list from a data validation?

To create a drop-down list in Excel using data validation, first select the cell or cells where
you want the drop-down list to appear. Then, go to the "Data" tab on the ribbon and click on
"Validation". In the Data Validation dialog box, under the "Settings" tab, select "List" from
the "Allow:" dropdown menu.

In the "Source:" box, either type in the list items separated by commas, or click the up arrow
button to select a range of cells containing the items you want in your list. Ensure that the
"In-cell dropdown" box is checked. Click "OK" to apply the data validation and create your
drop-down list.

22. Can you extract the domain name from an email address?

Assume the email address is [email protected] in cell A1. Enter the following formula in
another cell (e.g., B1): =RIGHT(A1, LEN(A1) - FIND("@", A1)), which will yield
email.com.

 FIND("@", A1) locates the position of the "@" character in the email address.
 LEN(A1) calculates the total length of the email address.
 Subtracting the position of "@" from the total length gives us the length of the
domain part.
 Finally, RIGHT(A1, LEN(A1) - FIND("@", A1)) extracts the domain part from the
right side of the email address.
23. What are wildcards in Excel? How do you apply them?

In Excel, wildcards are special characters used in text searches and functions to represent one
or more characters, allowing for more flexible and powerful searching and matching.

The three main wildcards are the asterisk (*), which represents any number of characters, the
question mark (?), which represents a single character, and the tilde (~), which is used to
escape wildcard characters.

You can use wildcards in various Excel functions


like SEARCH, FIND, REPLACE, SUBSTITUTE, and in features like filters or conditional
formatting. For example, using =COUNTIF(A1:A10, "*test*") will count all cells in the
range A1 to A10 that contain the word "test" anywhere in the text.

24. Can you apply a slicer to filter the data?

To apply a slicer to filter data in Excel, first, ensure your data is formatted as a table or is part
of a PivotTable. Click anywhere inside the table or PivotTable, then go to the ‘Insert’ tab on
the Ribbon and click on ‘Slicer’ in the Filters group. In the dialog box that appears, select the
checkbox for the column(s) you want to use for slicing, and then click ‘OK’. A slicer will
appear in your worksheet, which you can use to filter the data in the table or PivotTable by
simply clicking on the various options in the slicer.
7

25. What is Goal Seek?

Goal Seek in Excel is a tool that allows you to find the input value needed to achieve a
specific goal or target in a formula. It works by adjusting a single input value to make the
formula result match the desired outcome. You can access Goal Seek from the "Data" tab,
under the "What-If Analysis" button, where you specify the cell with the formula, the target
value, and the cell to change to achieve this target.

In the example below, we want to know what interest rate we'd pay if we made monthly
payments of $900 over a period of 15 years on a $100,000 loan. Goal Seek can help us figure
it out!
8

46. What is conditional formatting?


Conditional formatting is a method that allows us to identify the
characteristics (conditions) of a cell’s contents that are of interest
to us, and superimpose highlighting of cells or ranges that meet that
criteria. When a cell is updated with new information, the
conditional formatting will recognize and update itself. For instance,
if you wanted to apply a green highlight to any cell that contains the
letter Z, and you update Randolph to Ziggy, the conditional format
would automatically apply.

47. What is the limitation of the VLOOKUP function?


The VLOOKUP function can only move in one direction, from left to
right. Therefore, the information you wish to seek out must be
located in a column to the right of the lookup value’s location. In
newer versions of Excel, a successor to VLOOKUP has been added,
called XLOOKUP. This new function works in any direction and
defaults to exact matches rather than approximate. At some point
in the future, XLOOKUP will completely replace VLOOKUP, but this
will not happen until the majority of users have moved away from
using older versions of Excel.

48. Does VLOOKUP use case sensitive values?


VLOOKUP is not case-sensitive, and will always return the first
value of the match irrespective of the case. In other words, the
name Apgar and the acronym APGAR would be viewed as the same
by VLOOKUP. It is, however, possible to manipulate VLOOKUP into
returning case-sensitive values by using a helper column, or by
sorting your data in an ascending or descending order so that the
value you want is always the first to be encountered by VLOOKUP.

49. How do the INDEX and MATCH functions work in Excel?


You can use two MATCH functions within an INDEX formula to
specify a cell reference and return the value of that cell. The
dynamic formula will return the corresponding data of any two
MATCH values you input. For example, if you have a table detailing
the price per unit and the number of units sold for a variety of
products, you can use the match index function to return a specific
piece of information about a specific product.
9

50. What is the difference between COUNT, COUNTA, COUNTBLANK and COUNTIF
functions?
COUNT: This function counts how many cells within a specified
range contain numerical data. It will ignore (not count) any cells
that are blank or contain text or symbols only.

COUNTA: This function counts how many cells within a specified


range contain data of any type (the cell is filled). It will count all
cells that are not blank.

COUNTBLANK: This function will count the number of blank cells


within the designated range.

COUNTIF: This function will count only the cells whose value meets
a certain condition specified by the user.

51. What is Data Validation?


Data Validation limits the type of values that can be inserted into a
single cell or a set of cells by a user. It again works to limit user
input errors and keep the data inputs clean.

52. How can you measure an Excel percentage?


 Select the destination cell to display the percentage
 Then, type a “=” sign.
 Type in your reference, say A1/ A2, then hit the Enter key.
 Click on the Home tab, select the % symbol from the numbers group. This converts the value into a
percentage format.

53. Can you build Excel feature shortcuts?


Yes. It is possible to configure the ‘Easy Access Toolbar’ above the
home button to display your most commonly used shortcuts.

54. What are the alignments for Left, Right, Fill and Distributed?
 The left/right alignment aligns the cell’s contents to the left and right.
 Fill the cell with the same text repetitively, as the name suggests.
 Distributed spreads the text over the cell width.

55. How do you use Advanced Filters?


You can extract a unique list of items using Advanced Filters, or you
can also extract a particular item from various worksheets. It may
10

be assumed that the Advanced Filter is an advanced Auto Filter


variant.

56. What is an Excel Array formula?


With an array, a user can perform multiple calculations on multiple
items using just one formula. For instance, if you want to multiply
A1 by B1, A2 by B2, A3 by B3, and so on, instead of writing a formula
for each calculation, you can write =A1:A10*B1:B10 in cell C1, and
the results for each calculation will spill down the C column.

This is called a multi-cell array, as the results will be stored in


multiple cells. You can also create a single-cell array if, for
example, you wanted to sum the entirety of the values calculated by
the above array. This would look like: =SUM(A1:A10*B1:B10) and
return a single value calculated by adding the results of all ten
multiplications together.

57. How do you extract the first name from a full name in Excel?
The FIND function will return the numerical location of this target
(with the first character of the text being 1). The LEFT function can
then extract the number of characters specified by the FIND
function from the beginning of the text (i.e the left).

However, the value returned by FIND will include the space itself, so
we need to subtract 1 from the value in order to find the actual
ending point of the first name. The formula would look like
this:=LEFT(A1,FIND(“ ”,A1)-1).

A second method would separate the first names and last names
and deposit them into separate new columns, using the Text to
Columns feature found in the Data tab. We covered this earlier
under how to split information in a column. The Text to Columns
dialogue box will allow you to select the delimiter separating each
field (e.g space) and show you a preview of the result. The last step
will allow you to choose where you want the result to be displayed.

58. What is the difference between a function and subroutine in VBA?


It is the duty of a function to return the value of the mission it
performs. Subroutines, meanwhile, do not return the importance of
the assignment they perform. Functions are used as formulas, as
11

they are in spreadsheets. Subroutines are not used as formulas


directly inside spreadsheets.

59. What’s the distinction in VBA between thisworkbook and activeworkbook?


The name of the workbook from which the code is running is
provided by ThisWorkbook. ActiveWorkbook is as the name implies,
the workbook that is actually active in the numerous open
workbooks.

60. What is the easy way to go back to a specific area of a worksheet?


Using the name box is a fast way to return to a particular section of
the worksheet. To return to a particular area of a worksheet, you
can type the cell address or name of the range in the name box.

61. How do you handle circular references in Excel?


Circular references occur when a formula in a cell refers back to
itself either directly or indirectly. Excel will display a warning
message if it detects a circular reference, because it can cause the
program to calculate endlessly while never generating a result. It is
therefore critical to address the circular references immediately to
prevent them from potentially interfering with other formulas. To
identify and correct circular references:

 Go to the “Formulas” tab.


 In the “Formula Auditing” group, click on “Error Checking.”
 Choose “Circular References” to see where they exist.
 Check the formulas in the identified cells and adjust them to eliminate the circularity.

You might also like