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

Excel Interview Questions

all interview qtns

Uploaded by

Nitish .s
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
195 views

Excel Interview Questions

all interview qtns

Uploaded by

Nitish .s
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

What are the common/different types of workbooks?

Answer: Excels comes with variety of workbooks which are curated to suit the systems that we use.
• By default, the workbooks are saved as .xlsx which has no limitations unlike other workbook versions.
• To interact (import/export) with systems like RDBMS or any other DATA basis. Commonly used format is .csv
(comma separated values). This format allows user to save a single worksheet, format them before uploading it;
this helps the system to interpret the data in the format assigned while saving. Similarly, data exported from
servers/DBs are easily extracted in a CSV format
• Macros enabled files have an different format named as .xlsm. This will allow the file to run automated tasks
created in VB.
• Compatability mode: When workbook is shared over email or other channels, due to difference in versions
installed in the systems, workbook opens in compatibility mode (.xls is the 97-2003 version). To save workbook
with current version and be able to save with new features, one needs to convert the file into .xlsx version.
What is the definition of a CELL in Excel?
Answer: A cells defined as an intersection between a column and a row. Cells are identified /referred by address, which
is alphanumeric. Example A1 refers to Column A & row 1. When working with larger dataset and VBA, cell is referred as
R1c1(Row 1, column 1). An xlsx worksheet consists of a MILLION + rows & 16 thousand columns, when multiplied a
common excel sheet will have seventeen billion cells.
What is a name box?
Answer: Name box allows a user to know the active cell & also allows a user to jump a specific cell or cell range. The
name box is found on the top left of the worksheet, towards left of the formula bar. Via Name box one can assign a
name to a cell/cell range/data table, and can use that name to recall data and use in function and formulas
Name some of the reasons you would use Excel sheets?
Answer: Excel works very similar to any Database, which is used to capture data at a transaction level, the accumulated
data can further be analysed in forms of tables or charts. These functionalities can help one to achieve their goals, for
example a store to maintain it's daily transaction, a call centre to note its daily attendance and many more.
Database entry, can import data from any source, database management, Data cleaning, Data analysis, Report
Visualization, Dashboards (aids in decision making).
What is a ribbon?
Answer: Ribbon is a quick access to all the features built within excel, and is present in top of the worksheet below
worksheet name, as a horizontal stripe. These are visible on the top of the excel, ribbon have collection of different tabs
which have further bifurcation of groups & various commands. The ribbon has limited tabs shown which can be edited by
right click -> Customize Ribbon Option. This can be used to modify, add/remove group of commands/individual
commands from hidden tabs.
What is the use SUM and SUMIF ?
Answer: The sum function adds up two or more numbers into a single formula and give the final aggregated total. To
sum function can be used for multiple cells, to entire column or extend to multiple columns. However, the SUMIF
functions adds up two are more numbers with and additional feature of adding values only if certain criteria is met.
=SUMIF(criteria range, criteria, SumRange). Very similar to the SUMIF function we also have SUMIFS these allows use
to check for more than one criteria matching before adding any series of numbers. Eg. Assuming we have data table of
Expenses for the 12 months, by doing SUM we get the total expenses & with SUM we can bifurcate Expenses by
months.
What does an IF function do?
Answer: If function is used to test whether value is meeting certain criteria or not. The IF statement is also known as
conditional statement. The IF formula has three arguments
1. condition to text.
2. True if condition is met
3. False if condition is NOT met
What is the difference between now and Today?
Answer: The formula =TODAY() gives the calendar date as per the systems. However, the =NOW() argument returns
the date including the current hour, min & second of the day. By using these two functions the time stamp will be
refreshing during every recalculate situation, if we close the sheet on 1st Jan 2022 and reopen the sheet next day the
date will be automatically changed to 2nd Jan 2022. If we want to achieve date and time without using a function then
we can use the shortcut Ctrl + ; to add a date and to add time we must use Ctrl + Shft + ; This will ensure the date are
not dynamic.
What types of referencing does excel has?
Excel offers multiple types of referencing, namely fixed referencing or mixed referencing. Each of these have
their on used cases.
1.
2. Absolute Column, Relative Row
3.
Placing Dollar ($) before the alphabet like ($A1) refers that the column value must remain in the A position.
However, the row number can change as we copy and repeat the same formula into other cells.
2.
3. Absolute Row, Relative Column
4.
Placing Dollar ($) after the alphabet like (A$1) refers that the row number remains in the 1 row position.
However, the column name can change as we copy and repeat the same formula into other cells.
3.
4. Absolute Row, Absolute Column
5.
Placing Doller ($) before the alphabet and before the row number very similar to ($A$1). In this case the
reference will not change to any other column or cells, irrespective of any number of copy paste.
4.
5. Relative Column, Relative Row
6.
In this case both the row number and the column does not have any added symbols, example A1. Formula
containing cell A1 if repeated from the place it was created to any other cell will move its position accordingly.
A list of names are typed in incorrect case. Some in capital and some are in small case, we need to send emails
to these list of names which requires the list to be corrected, how you correct them?
Answer: To address this we must use a =PROPPER(name) function which will place the names in camel case.
Explain nested IF conditions?
Answer: IF() is used when one condition needs to be tested and only 2 respective outputs needs to be displayed, nested
IF() is used when more than 2 conditions needs to be checked with displaying respective output for each condition.
IF formula identifies a given condition is met or not, there are common needs that a given data has more than two
outcomes.
Example: I have data of average time taken to resolve a complaint in the column A & I want to know if the time taken
was within the group of 4 different times ( 2 , 4, 6 & Greater than 6). Single IF will tell if the value is within a single point
i.e., within 2 or beyon, to increase this we test the same value with the help of operators. The formula would look like
=IF(A2<=2,"2 hours",if(A2<=4,"4 hours",if(A2<=6,"6 hours",">6 hours"))).
What is Name manager, give a used case?
Answer: Name manager is a collection of a fixed data. By dedicating a name to a series of cells, we can refer them
directly by using the created name and avoiding going to the actual data location. This helps us to maintain a standard
fact table and helps reduce error reduction.
Example: I am asked to get employees contact number which exists in the employee_data base sheet and map it to
their attendance sheet. To perform this activity, one may choose to do VLOOKUP, the fact table would look like
employee_data!A1:A101 (assuming there are 100 employees), we can avoid the address mentioned before instead
create a name for this location like "edb" for the same range. This simple change can keep all the important data points
handy. To create a name to a given location you must go to the name manager from ribbon or press the short key Ctrl +
F3.
What is the use of a table? How to create a table?
Answer: Tables help group data into a structured format. Table can be created to any range, simply by pressing Ctrl + T,
excel identifies the active range as a table.
• The created table will have dedicated labels(headers) on the top with a filter enabled by default.
• Tables have the auto sum for a series of numbers by default, which can modify to other numerical aggregation
or even disable it
• Table to get auto filled vertically and horizontally. Imagine if a table is consisting timestamp in the first column
and about 10 more columns having other data points, if I want only date in the 12the column; I would be writing
single formula in the first row of column 12 and the rest will be auto filled including the formatting. Very similarly
if we add new data in the new empty rows which is after the last row from a table, the added data appends to
the current table with all the formatting.
• Since these are named as tables, any corresponding values will update automatically in case of a formula & in
case of a pivot; one must refresh the pivot to update the new changes.
Explain the combination of IF with other formulas?
Answer: IF function can be used to test more than one condition in a single IF clause, I will only have to add more
formulas to it like an AND condition otherwise I can also use OR, I can also use a combination of both.
The parenthesis, commas must be placed well else the calculations may be incorrect.
We have list of users who have their names with prefixed with Mr. Mrs. You are asked to show a summary of
contribution of married an unmarried. How will you achieve this?
Answer: To classify this data will have to use a combination of multiple functions. We will have to find Mrs first if found
we mark it as Mrs else we search for Mr then mark it as Mr.
=IF(ISERROR(FIND("Mrs",NAME,1)),IF(ISERROR(FIND("Mr",NAME,1)),"Neither Mrs nor Mr.","Mr"),"Mrs"). To once we
get the result, we can create a pivot to know the count, take the contribution of grad total; apply this as pie chart.
Explain Vlookup?
Answer: VLOOKUP stands for Vertical Lookup. When we have two tables, one having limited columns and some of the
data has to be found from the other table which has a unique identifier present, and the identifier is present in row order
then we use VLOOKUP. VLOOKUP has 4 arguments,
1. What data are we looking for,
2. Map with the first column of the Unique identifier to the total columns to the right till where we need data,
3. Count of columns (must be a positive number & not 0),
4. Do you want it to be matched exactly same or approximate is sufficient (0 = Exact, 1 = Approx.[FALSE,TRUE].
What happens if the fact table has multiple entries of unique identity in a fact table to the VLOOKUP?
Answer: Lookup matches the searched data in the given row from top to the bottom & if the Unique value that you are
searching is present more than once in the fact table, the output will be of the first row.
Assuming I have same phone number repeated for two employees and when I try do get the use name by using this
phone number the returned result will be of the first row from the top, the result will not explicitly mention there were two
rows having same number.
Can I do VLOOKUP matching column which is to the right and the data to pick up is to the left?
Answer: VLOOKUP is suited for data being arranged from the first column as the unique identifier(common column) and
the corresponding(Result column in source table) data to the right side of the Unique column. If the Unique column is to
the right and we want the required data is towards the left from the unique identifier, then VLOOKUP will give error.
To avoid this, VLOOKUP can be used with CHOOSE().Combination of such VLOOKUP is not only tedious task but
becomes more tedious if the columns are more or increasing.
To avoid this there are several other alternatives, like using INDEX with MATCH functions.
Explain what is Index function?
Answer: INDEX is one among the most versatile functions. INDEX gets output from an array (table), it has 3 mandatory
parameters array, row_num & column. Assuming the table has 100 rows with 4 columns, the INDEX would have the
array of 4 columns with 100 rows, the row number I want the data from followed with the column number, the output will
result in single value from the indexed location.
What is the used case of Index with Match?
Answer: INDEX is one among the most versatile functions. INDEX gets oupt from an array (table), it has 3 mandatory
parameters array, row_num and the column number. MATCH finds a number or a text value from a given condition,
MATCH has 3 mandatory arguments, what to match, array to match & match type (-1 less match, 0 exact match & 1
greater match).
A used case could be extracting data from table 1 which has all the corresponding details & table 2 is expected fetch
only a selected number of row, in the table 2 we have similar row identity and column names are same, by using match
we can get the row & column number, we use this with INDEX to retrieve the desired data.
What is Data Validation?
Answer: It validates the data to be entered based on underlined rules for the designated cell/cell range. For instance, We
have New Joined Information form, in the Name cell, Length of name should be more than 5 letters, if not excel should
not allow the entry and throw error pop box. This can be done using Data tab 🡪 Data Validation.
What is the shortest way to find the unique values from a given range?
Answer: We can use the function =UNIQUE(range) which will show all the unique values in the given range. This
function is available only in Office 365 version. Other versions can do the same activity, but it has a hard way, this is by
removing duplicate values from the range (we need to create a copy of the range, else we will spoil the original data), to
remove duplicates we must go to ribbon DATA>under data tools>REMOVE DUPLICATES. Or use ‘Advanced filter’ to
extract ‘unique value’ to other sheets.
What is a CORREL function?
Answer: CORREL is a shorter name of corelation, the function helps us to find if the two given variables have any
relationship with each other, -1 output mean the of one of the variables drops the other will increase or vis-a-vis. Positive
sign means if one increases the other variable also increases. Example, if the age of a person increases then the weight
increases is an example of positive corelation.
Can we use Formulas and functions to give Data Validation?
Answer: Yes, logical formulas can be used. Wherever logic output is ‘TRUE’, DATA validation will allow the value to be
entered otherwise stop it.
How do you create dropdown lists in Excel?
To create dropdown lists, follow the given steps:
Click on Data tab present in the ribbon
Then, from the Data Tools group, click on Data Validation
Navigate to Settings>Allow>List
Select the source list array
How to calculate a difference between two dates?
Answer: Difference between to valid dates can be found simply by subtracting the dates, then divide them into the output
format we expect. The output we get out of this would be in days, to convert it to year we divide it with 365.25 (.25 to
account the leap year), further to know difference in month we need to divide it with 30 days. By multiplying the output
with 24 will convert the difference into hours. Or Use Yearfrac(), it gives exact difference in years, where months and
days are displayed in decimals. For ex, 1 Jan 2020 minus 30 June 2021, will be 1.5 years. And hidden fundtion
=Datedif() can also be used to get difference in desired format, years, month,dates.
Name some Text Functions?
Answer: CONCATENATE( ) – used to join several text strings to one string.
TEXT( ) – Converting a value into text formatting.
PROPER ( ) – Arranging the characters in proper way.
LEFT ( ) – Returns the specified number of characters from the starting character.
Which function would you use to get the current date and time in Excel?
Answer: The following functions can be used:
TODAY() – This function takes no argument and would return the current date value.
NOW() – This function takes no argument and would return the current date and time value. Remember that that date
and time are stored as numbers in Excel. So that you can perform operations such as addition/subtraction with these
dates.
What is the way to get the week number of the year for a given date?
Answer: We can use the =WEEKNUM() function to know the week number for any given date.
We have a text string, how to identify the total characters in the cell?
Answer: To know the length of a string present a cell we must use the =LEN(string) which will show the count of
characters present in the given string. This includes all the spaces and special character present in the cell. String is the
‘text’ written in the cell, it can be a letter, word or sentence/s.
What is filter used for?
Answer: Filter feature helps us to get view only for selected values, this be further filtered to many other columns. To
apply a filter one can apply shortcut CTRL+Shift+L.
To move to the previous worksheet and next sheet, what keys will you press?
Answer: To move to the previous worksheet, you will use the keys Ctrl + PgUp, and to move to the next sheet you will
use keys Ctrl + PgDown.
Below table has set of sales done, what formula will you write to know how many repeat sales came from same
customer?
Answer: To do this we need to use the custom sort function which will arrange the data in the order to group same users
in to one order. (Custom sort is available from the ribbon>data>sort>custom sort: Add two level 1st Level, Customer ID
in ascending 2nd Level time of order from the customer in smallest to largest order. After the sort in an empty column
use if function, =if(A2<>A1,"Unique","Repeat").
OR create a separate report, Extract unique customer id/names and Use COUNTIFS() to calculate how many repeat
sales are there from same customer.
Name any 10 excel short cuts?
Answer: Short cuts save a lot of time & hence it is absolute to know as many short cuts as possible. To name some of
them,
1. The most used is the past special function Alt+E+S+V whcih will paste copied cells as values directly
2. Add & remove Filter Ctl+Shft+L
3. Ctrl + Space will select the entire column> We can add a column/s by pressing Ctrl+Shft+Plus will add column(s)
instantly
4. Sift + Space will select the entire row> We can add a row/rows in the selected rows by pressing Ctrl+Shft+Plus
will add row(s) instantly
5. Press Ctrl+; to add date
6. Press Ctrl+Shft+; to add time
7. Set cells to auto format by pressing Alt + O + C + A
8. Ctrl+A will select the active table, Ctrl+A if repeated twice will select the entire sheet
9. To toggle between open workbooks, use Ctrl + Tab & Ctrl+Shft+Tab to go reverse
10. To insert Sheet in the active workbook press Ctrl+F11 and to delete press rapidly Alt+E+L & enter will remove
the current worksheet.
What does Ctrl + D do?
Answer: This short cut is assigned to fill any data from above cell to below location
What is conditional formatting?
Answer: Conditional Formatting allows you to format a cell based on the value in it.
For example, if you want to highlight all the cells where the value in less than 30 with a red colour, you can do that with
Conditional Formatting.
What is a Combo Chart?
Answer: A combo chart is a combination of line and columns together in single chart. It comprises of two data point, for
example the total sales value in columns and % of profit earned in the line format. The Axis can be switched to Primary
and Secondary based on the objective. This make the chart more decipherable for conclusions.
What is the best way to represent performance of 4 zones in a single year?
Answer: Since the data is only for single numerical variable, ‘performance’ the best is to use a Pie chart. This will be a
clear representation of which zone’s performance. Remember, Pie chart will automatically convert ‘numbers’ into
‘percentage’. Plus pie chart should not be used to represent for more than 5 different zones.
You have data of total review &amp; % of profit we made for the last 4 months. How will you represent this
data?
Answer: I will choose to present this in a combo chart. Primary data point will be the total revenue the company made as
column and a line chart go show the profit % but as a secondary access as the prime will have integers and the profit is
in decimals.
You are being given a table of sales done by executives, I want you to highlight the top 5 executives with
highest sales. What will you do?
Answer: A built in function is available which can highlight a series of numbers are on top or bottom. To get to this we
will have to use the conditional format, go to ribbon&gt;Home&gt; under styles tab&gt; Conditional Format&gt;Top
Bottom Rules&gt;Top 10 items hit enter post selecting the range. The to 10 cells will be auto highlighted
What are the difference between Pivot Charts Vs Regular Charts
Answer: While Pivot Charts are amazing and come with the ability to update when the Pivot Table updates, these are
not as flexible as the regular charts.
In general, you can do a lot of customization in a regular Excel chart, but not in a Pivot chart. Also, if you customize a
Pivot Chart, and then update the Pivot Table, you are likely to lose the customization.
Despite the limitations, Pivot Charts are useful and can help create quick views from a Pivot Table.
What are slicers? what is the use if of it?
Answer: Slicers are a form of filters which are used along with the Pivot feature. Slicers can be of two types 1. Timeline
2. Attribute selections. Apart from filtering, slicer provides direct buttons on the screen to apply and remove filters. One
slicer can be connected to multiple reports and charts unlike Filter. This makes dashboard interactive, easy to drill-down
and User friendly
How many report formats are available in MS Excel?
Answer: There are three report formats in MS Excel – compact, report, and tabular.
What are appropriate charts you should use for a ‘Regionwise Sales report”, and why?
Answer: Based on unique name of regions, Bar chart, Column chart or pie chart can be chosen.
Lists the types of charts, and when they should be preferred ?
• If you have categorical data, use a bar chart if you have more than 5 categories or a pie chart otherwise.
• If you have nominal data, use bar charts or histograms if your data is discrete, or line/ area charts if it is
continuous.
• If you want to show the relationship between values in your dataset, use a scatter plot, bubble chart, or line
charts.
• If you want to compare values, use a pie chart — for relative comparison — or bar charts — for precise
comparison.
• If you want to compare volumes, use an area chart or a bubble chart.
• If you want to show trends and patterns in your data, use a line chart, bar chart, or scatter plot.
What are the basic principles of creating a dashboard?
Answer: Some of the basic principles must be followed when creating one must include.
• Who the audience is?
• Decide the flow- write it
• What value does the dashboard add?
• What type of dashboard to prepare, Operational, Analytical or strategic
• Make it interactive
• Keep in mind: No scrolling, keep required stuff and within a single page
• All reports need NOT to be on same sheet, you can connect multiple sheets later with 'Hyperlink'
• Add drill down by using form controls which can navigate to next levels of the metrics
• Include actional insights - this will help the audience to take actions against your insights
• Always name the Pivot reports
• Do Not use redundant reports and charts (giving same information).
• Keep it Simple
What is a dashboard?
Answer: Dashboards are highly effective in validating the effectiveness of the metrics captured over time and bring out
the leading trends. A dashboard is generally defined as a real-time tool which has easy to read user interface showing a
graphical presentation of data, it is also an effective way to take actionable insights.
A dashboard is an information management tool used to track KPIs, metrics, and key data points that are relevant to
your business, department, or a specific process. Dashboards aggregate and visualize data from multiple sources, such
as databases, locally hosted files, and web services. It would instantly answer important questions such which regions
are performing better and which products should the management focus on. These dashboards could be static or
interactive (where the user can make selections and change views and the data would dynamically update)
You have to add a chart to your dashboard & that is linked to a Pivot? How will it refresh?
Answer: To refresh the data source for any pivot table or charts linked with the pivot table, you need to go to the ribbon
Pivot Table Analyse> Data Refresh or use the short cut to execute this, Ctl+Alt+F5
Your dashboard has a date wise performance, you need to place arrows if the performance for current day is increased,
decreased or stable in the same cell. What will you do?
Answer: First add an additional column which has formula to calculate difference from previous to current value. To
highlight the data in the forms of arrows we will have to use conditional formatting, Select the range in new column, and
then go to the ribbon>Home>ConditionalFormatting>Icon Sets>Directional. This will show data in form of arrows.
Can a dashboard contain only tables or only charts?
Answer: yes, it can be combination of both too.

What is the use of pivot tables?


Another answer: Pivot tables is the feature in excel, which helps the user to make summarized reports, analyse data out
of a larger raw dataset. It helps to create ‘n’ number of reports from a single dataset. Filters, slicers, timelines are use to
drill down the reports to gain the insight into the data. For eg. Year wise sales, Top 5 performers and more.
What is the fastest way to prepare a summary of any given data?
Answer: The fastest way to summarize any data is to use the feature Pivot table. This show different types of statistics
within few clicks, to name sum, we can get SUM, AVERAGE, MAX, MIN, COUNT of a given column within few clicks.
This can be further visualized into various categories like day wise, month wise, year wise etc., by adding the
corresponding columns in the respective format a user prefers to view the table in.
What is the use of Group in a Pivot table?
Answer: You can group numbers in Pivot Table to create frequency distribution tables. This helps in analyzing numerical
values by grouping it into ranges. Grouping dates , given date column is in correct format, one can extract
year,month,days out of date.
What is the difference between Pivot and Power Pivot?
Answer: The basic difference between Power Pivot and Excel is that you can create a more sophisticated data model by
working on it in the Power Pivot window.
In Excel: Import data from different sources, such as large corporate databases, public data feeds, spreadsheets, and
text files on your computer.Import all data from a data source.
Tables can be on any worksheet in the workbook. Worksheets can have more than one table.
In PP: Filter data and rename columns and tables while importing.
Use Excel formulas.
Tables are organized into individual tabbed pages in the Power Pivot window.
Write advanced formulas with the Data Analysis Expressions (DAX) expression language.
What is a Data Model?
Answer: A Data Model allows you to integrate data from multiple tables, effectively building a relational data source
inside an Excel workbook. Within Excel, Data Models are used transparently, providing tabular data used in PivotTables
and Pivot Charts.
How can you merge multiple sheets into one?
Answer: There are different ways to append data from multiple sources into one, the hard way is to copy the data from
original files and paste them into a master file or use the get data option available in the data tab or even develop a VBA
code to execute this.
I prefer the get data option as it has many other built-in features like cleaning data, organizing it, it can also be created
as a data model for reuse in future. To access the multiple sheets appending open from the ribbon go to the data tab>
Get data > choose from the available options to start the process into Power Query and Power Pivot workspace.
Explain Power pivot tables and its uses?
Answer: A pivot table is a tool that allows for quick summarization of large data. It automatically performs a sort, count,
total or average of the data stored in the spreadsheet and displays result in another spreadsheet. It saves a lot of time.
How can you merge and append tables in Excel?
Answer: By using Merge and Append in Power Query, Get and Transform in Data Tab
How will you merge multiple sheets into a single sheet in a short period?
Answer: The fastest way to do this is to use a power query in office 365, to get to this. We need to file in same column
labels so that the tables/sheets can be mapped accordingly. Steps to get this are
1. Data tab > Get Data > From File > From Folder
2. Select the folder, Click ok and at the folder screen click Transform Data:
3. Expand the Tables, Click on the double down arrow on the Custom column > click OK:
We can further modify the data, columns that we need/and we do not need and load it all as a data model, load it as a
power pivot or load as a table. With these simple process we can more data present in single folder into single sheet
with very easy steps.
What is grouping in a Pivot table?
Answer: Grouping in pivot tables helps understand a frequency of a number. This works only for columns having
numbers. Assuming we have a column having age of certain population, to know the count of different age groups we do
not require to create another supporting column. Use the group feature after creating the pivot, drop the age field into the
row section then group it by 5. this will show the minimum + 5 till the max and the value field can be count or contribution
count. Grouping is used for ‘Date and Time’ data also, to see range of duration. The column should be formatted as
‘date and time’. One can group time from seconds, minutes, hours, days, Quarters, Months and years.
What are macros in Excel?
Answer: Macros are the action recorder of excel, it records the user steps of execution of any task, interpret them into
VBA codes and save it. Thereafter, it help us to redo a set of actions within Excel repeatedly. Macros can be executed
in different ways example on_open, on close, at a click of a defined button, after a cell is changed extract. Macros help
reduce the manual efforts also increase the accuracy.
How can we repeat same task multiple times?
Answer: Repeating same activity multiple times we can use the Macro feature. To repeat a set of instructions, we can
either record a macro, the option available in the ribbon, under the developer tab or even go to the code editor window
and code the steps using the VBA (code editor).
How to create a simple macro to enter time stamp.
Answer: This can be achieved by recording a macro. We need to go the Developer tab in the ribbon> Click on record
macro> Give a name> Click OK. On any empty cells type =NOW()>Ctrl+Enter>Ctrl+C>Alt+S+E+V>Esc. By doing this
we have entered the current time by using now() function, to ensure we complete the function and remain in the active
cells we use Ctrt + Enter> We copy paste the same value in the active cell which will ensure the time stamp does not
change. To re-execute this macro we can go to macro & press the run button or assing the macro to an image or even
assign a short cut at the time of creation itself.
How to access the code of an existing macro?
Answer: To access the existing code we need to go to the ribbon > View tab/Developer tab> Under controls>View
Code. This will open the VBA code editor window.

A created macro needs to be assigned to a button.


Answer: To assign an existing macro to a button we need to insert the icon or an button from its respective menus, then
right click on the image or button click on assign macro. The assign macro dialog box will show up all existing macros
present in the current workbook. Choose the macro name and click OK.
Explain what is a FOR loop?
Answer: The For loop is a control structure that allows the user to write a loop that will be executed a specific number of
times. In this case, the user specifies the number of times they want the loop to run. For loop is classified into Next Loop
and For Each Loop.
What is a DIM stands for in a VBA script?
Answer: DIM stands for dimension, these are objects which are to be declared when writing a code. Objects can be of
different types, Numbers, Letter, Sentences, Worksheets, Workbooks, Cells, Range Etc
What does Sub mean in a VBA script?
Answer: Sub is a short name to subroutine. Each macro step starts with the key word called SUB and ends with an END
SUB. without which a Macro cannot be created.
Name some of the data types in VBA?
Answer: Some of the common types of data types that can be declared are
INT – INT stands for integer which can only store natural numbers only
FLOAT – Float is another form of data type that is used for numbers which can contain decimals
STRING – Stings are used when we need to pass text data
BOOLEAN – Boolean data types can store only true or false values
What is an INT data type in VBA?
Answer: INT means Integer which can handle only numerical values, by default the value of any assigned variable with
such data type is 0. The size of such variable is of 2 KB & it can handle numbers from –32,768 to 32,767.
What is the use of an immediate window in VBA code window?
Answer: The immediate window can help us run temporary code and get the instant results. To get the immediate
window in the code window we need to go to the menu bar>View>Immediate Window or press CTRL+G.
A created macro needs to be assigned to a button.
Answer: To assign an existing macro to a button we need to insert the icon or an button from its respective menus, then
right click on the image or button click on assign macro. The assign macro dialog box will show up all existing macros
present in the current workbook. Choose the macro name and click OK.
How can you stop VBScript when it goes into the infinite loop?
Answer: Ctrl + Pause/Break is used to stop VBScript if it goes into an infinite loop.
How can you pass arguments to VBA functions?
Answer: If the arguments are approved to VBA function, the following two ways will help in passing the arguments to
VBA functions:

• ByRef – The called procedure may change the value of the argument passed


• ByVal – The called procedure does not want to change the value of the argument passed

How to Run a Macro?
You can run a macro from the list of macros. On the Developer tab, there’s a button called macros and when you click
on this button it gives you a dialog box with a list of macros that you have in all the open workbooks.

You might also like