Excel Interview Questions - Intermittent
Excel Interview Questions - Intermittent
https://www.simplilearn.com/tutorials/excel-tutorial/excel-interview-questions
2. ? (Question mark)
It represents one single character.
The example below shows how to filter a particular customer name.
3. ~ (Tilde)
It is used to identify a wildcard character (~, *, ?) in the text.
In the following example, we are filtering How?* using the tilde (~) symbol.
2
In the following example, we have applied data validation to the ‘Name’ column to accept only text
values. If you enter something other than a text, it will throw an error.
28. Given below is a student table. Write a function to add pass/fail to the results column based on
the following criteria.
If student marks > 60 and attendance > 75%, then pass else the student fails.
3
31. From the below table, find the descriptive statistics of the columns using the Data Analysis
ToolPak in Excel.
4
Click on the Data Analysis option in the Data tab. Choose Descriptive Statistics.
Below is the summary table for the columns and their respective statistical measures.
32. Using the Coronavirus dataset, create a pivot table to find the total cases in each country
belonging to their respective continents.
First, drag the continent and country columns into rows. After that, drag the cases column on to the
values section.
5
33. How do you provide Dynamic Range in ‘Data Source’ of Pivot Tables?
Dynamic Range in the data source of pivot tables is used to make your pivot table dynamic to adjust
to new data when refreshed automatically.
Create a Named table to provide a dynamic range. Go to the Insert tab and select Table.
35. Create a pivot table to find the top three countries from each continent based on the total cases
using COVID data.
Create a pivot table using the coronavirus dataset by dragging sales into values.
6
The Insert Calculated Field box appears. Give a name to the column and insert the formula by
selecting the existing columns from the pivot table. Click Add ----> OK to create the column.
In the below example, we have created two slicers (months, countries, and territory) to filter the
pivot table.
38. Use the coronavirus dataset to find the percentage contribution of each country and continent to
the total cases?
Create the pivot table to show the total cases by country and continent.
Right-click on the sum of cases column and under Show Value As, select “% of Grand Total.”
In Excel, SUM, SUMIF, and SUMIFS are functions used to calculate the sum of a range of
cells, but they differ in their calculation approaches.
The SUM function simply adds up all the numbers in the specified range.
Example: =SUM(A1:A10) will add all the numbers from cells A1 to A10.
SUMIF adds up cells that meet a single specified criterion. Example: =SUMIF(A1:A10,
">5") will sum all numbers greater than 5 in the range A1 to A10.
14. What's the difference between COUNT, COUNTA, COUNTBLANK, and COUNTIF?
In Excel, COUNT, COUNTA, COUNTBLANK, and COUNTIF are functions used for
counting cells in a range, but each serves a different purpose.
The COUNT function counts the number of cells in a range that contain numbers. It ignores
empty cells, text, or other non-numeric values. Example: =COUNT(A1:A10) will count only
the cells in the range A1 to A10 that contain numbers.
10
COUNTA counts the number of non-empty cells in a range, regardless of the cell's content
(numbers, text, or other types). Example: =COUNTA(A1:A10) will count all cells in the range
A1 to A10 that are not empty.
COUNTIF counts the number of cells in a range that meet a specified criterion.
Example: =COUNTIF(A1:A10, ">5") will count the number of cells in the range A1 to A10
that contain numbers greater than 5.
In Excel, both SUBSTITUTE and REPLACE are text functions used to modify string
contents, but the string replacement methods are different.
The SUBSTITUTE function replaces specified occurrences of a text string with another text
string.
It is particularly useful when you need to replace specific text within a string and can be used
to replace all occurrences or just a specific instance. Example: =SUBSTITUTE("Hello
World", "World", "Excel") will change "Hello World" to "Hello Excel". You can also
specify which occurrence of "World" to replace if it appears multiple times.
The REPLACE function, on the other hand, substitutes part of a text string based on its
position and the number of characters associated with the string. Example: =REPLACE("Hello
World", 7, 5, "Excel") starts at the 7th character (W), replaces 5 characters ("World")
with "Excel", also resulting in "Hello Excel".
VLOOKUP, short for Vertical Lookup, is a function in Excel used for searching for a
specific value in one column and retrieving a corresponding value from another column in the
same row. It's particularly useful in scenarios where you need to find and extract data from
large tables or datasets.
Example: We're interested in returning the employee name (see mapping table E1:F11, where
column E stores the employee ID and column F stores the employee name) based on the
employee ID found in column A. =VLOOKUP(A2,$E$2:$F$11,2,0) will return "Sue", in the
example below.
11
To create a Pivot Table in Excel, first select the data range you want to analyze. Next, go to
the "Insert" tab on the ribbon and click on "PivotTable." In the dialog box that appears,
choose where you want the Pivot Table to be placed (new worksheet or existing worksheet).
After clicking "OK," the PivotTable Field List pane will appear, where you can drag fields to
the different areas (Rows, Columns, Values, and Filters) to organize your data.
To create a named range in Excel, first select the cell or range of cells you want to name.
Click on the "Formulas" tab in the ribbon. Then click on "Define Name" in the "Defined
Names" group. In the "New Name" dialog box, enter a name for your range in the "Name"
field, and specify the scope and cell reference if needed. Finally, click "OK" to create the
named range.
To protect an entire workbook in Excel, navigate to Tools > Protection > Protect
Workbook. Enter a password in the dialog box that appears, and then re-enter it when
prompted for confirmation. This will encrypt the workbook, requiring the password to open it
in the future.
12
26. What is an Excel chart, and how many types of charts are there?
A chart in Excel is a feature that allows you to display data through
a range of visually intuitive graphs. These charts and graphs can
make it easier and quicker to comprehend data, in comparison to
just looking at the numbers on the worksheet. Available charts on
Excel include:
Bar graphs
Line graphs
Pie charts
Area graph
Scatter graphs
Surface graphs
Doughnut graphs
Radar charts
Excel worksheet data, data feeds, text files and other such data
formats can be imported, but you will need to create relationships
between the imported tables and those in your worksheet before
using them to create a pivot table.
35. How do you find the day of the week for a particular date in an Excel sheet?
You can do this by using the WEEKDAY function. First, enter the
formula in the required cell, WEEKDAY(A1,1). The second argument
(1) determines to what day excel will assign the value. Press Enter,
and the Formula will return 3, meaning that your date is the 3rd day
of the week.
38. What is the default value of the last parameter of the VLOOKUP function?
If the last parameter is not specified via TRUE or FALSE, the return
value will default to TRUE (approximate), and show an approximate
match for your request. This is usually not what you are looking to
accomplish, as the typical use case for VLOOKUP is to find an exact
match.
15
1. Click the pivot table, select Analyze, and then select Refresh from the pivot table tools menu.
2. Right-click the pivot table and select Refresh.
3. Use the keyboard shortcut Alt+F5.
You can also refresh all pivot tables within a workbook at once by
selecting the arrow underneath the Refresh button in the pivot table
tools menu, and select Refresh All.
Bonus Question: What is the difference between “Relative”, “Absolute”, and “Mixed” cell
references in Excel?
In Excel, when copying formulas from one cell to another, the way
cell references are treated can differ depending on their type:
Relative reference (e.g., A1): When copying this type of reference from one cell to another, it adjusts
based on the relative position of the cell. For instance, if you copy a formula from cell B2 that
references A1 to cell B3, the reference will automatically change to A2.
Absolute reference (e.g., A1): This reference type remains constant regardless of where you copy the
formula. It will always refer to the specified cell.
Mixed reference (e.g., A1 or A1): In this type, one part (either row or column) remains constant
while the other part adjusts. If you copy the formula with A1 from cell B2 to B3, it will still reference
A1. However, if copied from B2 to C2, the reference will change to B1.
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
19
lastColumn = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
MsgBox (lastColumn)
End Sub
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.
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.
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 example@email.com 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.
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.
22
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!
23
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.
COUNTIF: This function will count only the cells whose value meets
a certain condition specified by the user.
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.
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.