KEMBAR78
Chapter 2 Lookups, Logical Conditions and Other Functions | PDF | Microsoft Excel | Computer Engineering
0% found this document useful (0 votes)
12 views20 pages

Chapter 2 Lookups, Logical Conditions and Other Functions

Chapter 2 covers various functions in Excel, focusing on logical functions like IF, nested IF, IFS, AND, OR, and XOR, explaining their syntax and use cases. It also introduces VLOOKUP and HLOOKUP for data retrieval, detailing their differences and providing examples. Additionally, the chapter discusses the MATCH function and how to perform case-sensitive lookups.

Uploaded by

subhajit.gowebs
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)
12 views20 pages

Chapter 2 Lookups, Logical Conditions and Other Functions

Chapter 2 covers various functions in Excel, focusing on logical functions like IF, nested IF, IFS, AND, OR, and XOR, explaining their syntax and use cases. It also introduces VLOOKUP and HLOOKUP for data retrieval, detailing their differences and providing examples. Additionally, the chapter discusses the MATCH function and how to perform case-sensitive lookups.

Uploaded by

subhajit.gowebs
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/ 20

Chapter 2: Working with Functions

1. Explain the purpose of the IF function in Excel. Provide an example.


Ans: The IF function in Excel is used to perform logical tests and return different values based on whether the condition is TRUE or
FALSE.
If you’ve ever needed to check whether a value meets certain criteria, then the IF function is the tool you’ll want to master.
In simple terms, the IF function evaluates a condition and returns one result if the condition is true and another if it’s false.
Syntax: =IF(logical_test, value_if_true, value_if_false)
• logical_test → The condition to be tested (e.g., A1 > 60).
• value_if_true → The value to return if the condition is TRUE.
• value_if_false → The value to return if the condition is FALSE.

For example : =IF(A1>60, "Pass", "Fail")

The IF function supports the logical operators( <,>,<=,>=,=) to test logical arguments.

2. What is a nested IF function? How is it different from a simple IF function?

Ans: A nested IF function is when multiple IF conditions are placed inside a single formula to handle multiple possible outcomes.

Syntax : =IF( condition1, Value if true1 ,IF(Condition2, Value if true2, Value if false2))

When talking about difference between both it can be:


• Simple IF → Evaluates one condition and gives two possible outcomes.

• Nested IF → Evaluates multiple conditions sequentially and gives more than two possible outcomes.

For example ; =IF(A1>80, "A", IF(A1>60, "B", "C"))

If A1 > 80 → Returns "A". If A1 is between 61-80 → Returns "B", Otherwise, returns "C"

3. What is the difference between IF and IFS functions in Excel?

Feature IF Function IFS Function


Purpose Checks a single condition Checks multiple conditions
sequentially
Syntax =IF(condition, =IFS(condition1,
value_if_true, value1, condition2,
value_if_false) value2, …)
Example =IF(A1>50, "Pass", "Fail") =IFS(A1>80, "A",
A1>60, "B", TRUE,
"C")
Nesting Requires multiple nested IFs for Eliminates need for nested
multiple conditions IFs
Readability Becomes complex with multiple IFs Easier to read

4. Differentiate between the OR and NOT functions with an example.


Ans : In Excel, the IF function allows you to make a logical comparison between a value and what you expect by testing for a condition
and returning a result if that condition is True or False.
=IF(Something is True, then do something, otherwise do something else)
But what if you need to test multiple conditions, where let’s say all conditions need to be True or False (AND), or only one condition
needs to be True or False (OR), or if you want to check if a condition does NOT meet your criteria? All 3 functions can be used on their
own, but it’s much more common to see them paired with IF functions.
A condition OR returns TRUE if one (or more) tests of the function is true. So, you use the OR function in a different situation
where you accept many cases.

Feature OR Function NOT Function


Definition Returns TRUE if at least one Returns the opposite (negation)
condition is TRUE. of a condition.
Syntax =OR(condition1, condition2, =NOT(condition)
...)
Output TRUE if any condition is TRUE, else TRUE if the condition is FALSE,
FALSE. else FALSE.
Example =OR(A1>50, B1<100) → If A1 = =NOT(A1>50) → If A1 = 60,
60 and B1 = 110, result = TRUE. result = FALSE.
Use Case Used when multiple conditions can Used when checking if a
satisfy a requirement. condition is not met.

5. What happens if the OR Function is used without any arguments?


Ans: When the OR function is used without any arguments, it returns FALSE. This is because OR requires at least one condition to
evaluate, and with no arguments, there’s nothing to check.
6. Differentiate between AND, OR, and XOR functions in Excel?
Ans:
Feature AND Function OR Function XOR Function
Definition Returns TRUE if all conditions are Returns TRUE if at least one Returns TRUE if an odd number of
TRUE; otherwise, returns FALSE. condition is TRUE; otherwise, conditions are TRUE; otherwise, returns
returns FALSE. FALSE.
Syntax =AND(condition1, =OR(condition1, =XOR(condition1, condition2,
condition2, …) condition2, …) …)
Use Case Used for strict conditions where all Used when at least one Used when you want only one
criteria must be met. condition needs to be TRUE. condition to be TRUE (odd count).
Example 1 =AND(A1>50, B1<100) (A1=60, =OR(A1>50, B1<100) (A1=60, =XOR(A1>50, B1<100) (A1=60,
B1=110) B1=110) B1=110)

Output 1 FALSE (since B1 is not <100) TRUE (since A1 is >50) TRUE (one condition is TRUE, an odd
count)

Example 2 =AND(5>3, 10>8) =OR(5>3, 10<8) =XOR(5>3, 10>8)

Output 2 TRUE (since both conditions are TRUE (since at least one FALSE (since both conditions are TRUE,
TRUE) condition is TRUE) an even count)

7. What is the result of =AND(TRUE, FALSE, TRUE) and =OR(TRUE, FALSE, FALSE)?
Ans:
▪ =AND(TRUE, FALSE, TRUE) → FALSE (because all conditions must be TRUE).
▪ =OR(TRUE, FALSE, FALSE) → TRUE (because at least one condition is TRUE).

8. How do blank cells affect the OR function, and how can this issue be resolved?
Ans: Blank cells in logical tests are treated as FALSE, which can lead to unintended outcomes. For example: =OR(A1>50, A2)
If A2 is blank, Excel treats it as FALSE, which may cause the function to return FALSE unexpectedly.
To handle blank cells properly, use the ISBLANK function:
=OR(A1>50, NOT(ISBLANK(A2)))

Which ensures that the function returns TRUE if A2 is not blank, even if A1 does not satisfy the condition.

9. How do blank cells affect the AND function?


Ans: Blank cells in logical expressions are treated as FALSE. If a blank cell is included in an AND formula, it may result in an unexpected
FALSE output.
=AND(A1>50, A2)
If A2 is blank, Excel treats it as FALSE, making the entire function return FALSE.
To handle this, use the ISBLANK function same as when dealing OR:
=AND(A1>50, NOT(ISBLANK(A2)))
10. What happens if the AND function is used without arguments?
Ans: If the AND function is used without any arguments, like: =AND()
It will return TRUE because there are no FALSE values to evaluate. However, this is not a recommended usage, as it does not serve a
practical purpose.
11. Why does the AND, OR function sometimes return FALSE unexpectedly?
Ans: The AND function as well as OR functions returns FALSE if any of the conditions evaluate to FALSE. This can happen due to:
• Incorrect logical expressions.
• Referencing blank cells (which are treated as FALSE).
• Using an invalid range or missing conditions.
12. Explain the purpose of VLOOKUP in Excel. Provide a syntax example.
Ans: The term VLOOKUP stands for Vertical Lookup. It is designed to search for a specific value in the first column of a table (lookup
column) and retrieve corresponding data from a different column in the same row.

Syntax: VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

i. lookup_value: The value you want to search for (e.g., a specific ID, name, or product code).
ii. table_array: The range of cells that contains the data (the table you’re searching through).
iii. col_index_num: The column number (from the table array) that contains the data you want to retrieve. The first column is 1, the
second is 2, and so on.
iv. [range_lookup] (optional): If TRUE (or omitted), it searches for an approximate match. If FALSE, it searches for an exact match.

13. How does VLOOKUP works in excel?


Ans: Suppose you have a given dataset called Library_vlookup.xlsx file(given in the group). The goal is to find the student’s name based
on their Student ID.

Steps are:

❖ Step 1: Open Excel and load the Library_vlookup.xlsx file.


❖ Step 2: Locate the sheet containing student data (e.g., "Sheet1").
❖ Step 3: As we want to find the name of the student with Student ID "std1003".
❖ Step 4: Click on an empty cell where you want the result (e.g., J2).
❖ Step 5: Type the formula in the formula box
=VLOOKUP("std1003", A2:H10, 2, FALSE)
Or you can select the lookup value by choosing the cell reference such as:
=VLOOKUP("A5", A2:H10, 2, 0)

Remember to Add a comma after the lookup value to move to the next part of the formula.

❖ Press Enter.

OUTPUT: Karel Florian


Here,

"std1003" => This is the value we are searching for (Student ID).
A2:H10 => The range where data is stored.
2 => The column number that contains the required information (Student Name is in the 2nd column).
FALSE / 0 => Ensures an exact match.
TRUE / 1 => Ensures an approximate match.
14. What will happen if VLOOKUP is used with a range that is not sorted, and the last argument is TRUE?
Ans: If the last argument (range_lookup) is TRUE, VLOOKUP assumes the data is sorted and may return incorrect results if the data is
unsorted.
15. How do you perform a case-sensitive lookup in Excel?
Ans: Excel’s standard VLOOKUP is not case-sensitive. However, you can use INDEX and MATCH with EXACT to make it case-sensitive.
Example:

=INDEX(B2:B10, MATCH(TRUE, EXACT(A2:A10, "Excel"), 0))

This looks for the exact case-sensitive match of "Excel" in A2:A10 and returns the corresponding value from B2:B10.
16. What is HLOOKUP in excel?
Ans: The HLOOKUP Function in Excel searches for a value in the top row of a table or array and returns a value in the same column from
a specified row. Although less popular than its vertical counterpart, VLOOKUP, this function is ideal for data arranged horizontally, where
lookup values are stored in the first row.
Syntax: HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Where,

i. lookup_value: The value you want to search for in the top row of the table.
ii. table_array: The range of cells that contains the data. The top row of this range will be searched for the lookup_value.
iii. row_index_num: The row number in the table_array from which to return a value. The top row is row 1.
iv. [range_lookup]: An optional argument. Use TRUE for an approximate match (default), or FALSE for an exact match.
17. Discuss some usage of hlookup?
Ans:

 Your data is organized horizontally.


 You need to retrieve information from a specific row based on a lookup value.
 You require exact or approximate matches in your lookup operation.
18. How does HLOOKUP works in excel? Explain with proper example.
Ans: Suppose you have a given dataset called Library_vlookup.xlsx file(given in the group). The task is to find the column header where
"BOOK TITLE" is located.

Steps are:

❖ Step 1: Open Excel and organize the data so that the lookup value resides in the
first row of a range or table, for example : Library_vlookup.xlsx file.
❖ Step 2: Locate the sheet containing student data (e.g., "Sheet1").
❖ Step 3: Choose a Cell to Enter the Formula (e.g., J3)
❖ Step 4: Enter the formula in the formula box
=HLOOKUP("BOOK TITLE", A1:H2, 2, FALSE)
❖ Step 5: Press Enter.
OUTPUT : returns the book title under the "BOOK TITLE" column.

Here,

"BOOK TITLE" => The value we want to find.


A1:H2 => The table range (including headers).
2 => The row index number from which to retrieve the value.
FALSE => Ensures an exact match.
Remember, If HLOOKUP cannot find the lookup_value, it will return an #N/A error.

19. How is HLOOKUP different from VLOOKUP?


Ans:
Feature VLOOKUP HLOOKUP
Orientation Searches data vertically (in columns). Searches data horizontally (in rows).
Syntax =VLOOKUP(lookup_value, =HLOOKUP(lookup_value,
table_array, col_index_num, table_array, row_index_num,
[range_lookup]) [range_lookup])

Search Direction Finds a value in the first column and Finds a value in the first row and retrieves
retrieves from a specified row. from a specified column.
Best Use Use when data is organized in columns. Use when data is organized in rows.

20. How does the MATCH function work? Provide an example.


Ans: The MATCH function returns the position of a value in a row, column, or table, rather than the actual value itself. For Example, if
you’re looking for the number “50” in a list of numbers and it’s the 8th item, the function will return the number 8.

Syntax: =MATCH(lookup_value, lookup_array, [match_type])

Here, The Arguments are:


i. lookup_value: The value you want to find in the array (e.g., a number, text, or logical value).
ii. lookup_array: The range of cells to search within.
iii. [match_type] (optional):
iv. 1 (default): Finds the largest value less than or equal to the lookup_value. The array must be sorted in ascending order.
v. 0: Finds an exact match.
vi. -1: Finds the smallest value greater than or equal to the lookup_value. The array must be sorted in descending order.
The match_type argument in the MATCH function is optional. If not specified, it defaults to 1 (exact match or the next smallest
value). Depending on the value provided, MATCH can perform either an exact or an approximate match. Here’s how each match
type works:

Remember in MATCH,
1 and -1: Often referred to as “approximate matches,” but the MATCH function will still return an exact match if one exists.
Sorting: Proper sorting of the lookup array is crucial for match_type values 1 and -1.
Default: If match_type is omitted, Excel assumes it is 1.

Suppose you have a given dataset called Library_vlookup.xlsx file(given in the group). The goal is to find the position of "CONTACT
PHONE" in the header row.

To satisfy this need, we will follow some steps given below:


❖ Step 1: Open Excel and organize the data.
❖ Step 2: You have the following data in, for example : Library_vlookup.xlsx
file.
❖ Step 3: Locate the sheet containing student data (e.g., "Sheet1").
❖ Step 4: When a user needs Exact Match with MATCH, you need to find the exact position of a value in a range, set match_type to 0.
To do this, Click on an empty cell (e.g., J4).
❖ Step 5: The formula will be: =MATCH("CONTACT PHONE", A1:H1, 0)
❖ Step 6: Press Enter.
Here,
"CONTACT PHONE" => The value whose position we need.
A1:H1 => The row where we are searching.
0 => Exact match mode.

Let’s say we want to find the position of a student who borrowed books for 6 days, using approximate matching in column G (Days
Borrowed).

That means we need, The Approximate match (sorted list required).

For this, the formula will be: =MATCH(6, G2:G10, 1)

Where, 6 → The number of days we are looking for.

G2:G10 → The "Days Borrowed" column.

1 → Approximate match (sorted list required).

Output : If the available values in column G are {3, 5, 7, 8, 10}, Excel will return the position of 5 (as it is the largest number
≤ 6).

21. Briefly explain the MATCH types in MATCH Function.


Ans:

Match Type Behaviour Details


1 Approximate Match Finds the largest value less than or equal to the lookup value. The array must be
sorted in ascending order.
0 Exact Match Finds the first value exactly equal to the lookup value. Sorting is not required.
-1 Approximate Match Finds the smallest value greater than or equal to the lookup value. The array must
be sorted in descending order.
(omitted) Approximate Match Defaults to 1, performing as described for match_type = 1.
22. What is the INDEX function? How does it work?
Ans: The INDEX function returns the actual value from a specified row and column in a range.
Syntax: =INDEX(array, row_num, [column_num])
Where,
array => The data range.
row_num => The row number to retrieve data from.
column_num (optional) => The column number to retrieve data from.
For example, =INDEX(A2:H10, 3, 5)

Retrieves the value from 2nd row and 3rd column of A2:C5.

OUTPUT: "Science & technology textbook"

23. How is a nested VLOOKUP used with MATCH? Provide an example.


Ans: A nested VLOOKUP with MATCH allows the column index to be determined dynamically using the MATCH function.
Syntax: =VLOOKUP(A2, A5:D10, MATCH("Salary", A4:D4, 0), 0)

24. How does MATCH + INDEX works?


Ans: The goal is to retrieve the book title for a student with Student ID "std1002".
Formula will be:
=INDEX(A2:H10, MATCH("std1002", A2:A10, 0), MATCH("BOOK TITLE", A1:H1, 0))
The above formula signifies as,
• MATCH("std1002", A2:A10, 0) finds the row number where std1002 is located.
• MATCH("BOOK TITLE", A1:H1, 0) finds the column number where "BOOK TITLE" is located.
• INDEX(A2:H10, row, column) retrieves the value at the intersection.
OUTPUT:"Autobiography"
25. What do you mean by XLOOKUP? Explain with example.
Ans: XLOOKUP is a powerful function in Excel designed to search for a specific value in a range and return a corresponding value from
another range. It replaces older functions like VLOOKUP and HLOOKUP, addressing their limitations by allowing for more flexible
searches, including reverse lookups and partial matches.
Syntax: =XLOOKUP(lookup_value, lookup_array, return_array, [if _not_found], [match_mode], [search_mode])
Arguments explanation:
lookup_value: The value you want to search for.
lookup_array: The range of cells where Excel will search for the lookup value.
return_array: The range of cells from which to return the result.
if_not_found (optional): Value to return if no match is found.
match_mode (optional): Specifies the type of match (exact, approximate, or wildcard).
search_mode (optional): Determines the search direction (first-to-last or last-to-first)
Match Type Behaviour
0 (default) Here it will look for an exact match
-1 If we do not get the exact match then it will return the next smaller item.
1 If we do not get the exact match then it will return the next larger item.
2 It will do partial matching using (* or ~)

In case of search_mode (Optional), where we can specify how the function should look up the value.

Search mode Behaviour


1(default) It will search the values first.
-1 It will search the values in reverse from last.
2 It will perform a binary search and data needs to be sorted in ascending order.
-2 It will perform a binary search and data needs to be sorted in descending order.
Suppose you have a given dataset called Library_vlookup.xlsx file(given in the group). And the goal is to retrieve the contact email for
Student ID "std1004"
For this we will follow few steps :
❖ Step 1: Open Excel and organize the data so that the lookup value resides in the
first row of a range or table, for example : Library_vlookup.xlsx file.

❖ Step 2: Locate the sheet containing student data (e.g., "Sheet1").


❖ Step 3: Click on an empty cell (e.g., J7). Remember to close the parentheses and
press Enter. Your formula should now return the corresponding value

based on your criteria.

❖ Step 4: Write the formula:


=XLOOKUP("std1004", A2:A10, C2:C10)
❖ Step 5: Press Enter.
OUTPUT: scott@example.com

In this case,

"std1004" → Lookup value.


A2:A10 → The column with Student IDs.
C2:C10 → The column with Contact Emails.
26. Why is XLOOKUP preferred over VLOOKUP and HLOOKUP?
Ans: The XLOOKUP function is an improved lookup function in Excel, replacing both VLOOKUP and HLOOKUP. It is introduced in 2019,
which means from 2019 version we can use XLOOKUP as an alternative of VLOOKUP and HLOOKUP. Let’s analyse it through a table
format.

Feature XLOOKUP VLOOKUP & HLOOKUP


Lookup Direction Works for both vertical and horizontal lookups VLOOKUP (vertical) and HLOOKUP (horizontal)
Performance Faster and more efficient Slower with large datasets
Column Restriction No column index number needed Requires specifying a column number
Returns Exact or approximate matches by default Defaults to approximate match
Example =XLOOKUP (101, A2:A10, B2:B10, "Not Found") =VLOOKUP (101, A2:C10, 2, FALSE)
27. Compare between all lookup types.
Ans:

Feature VLOOKUP HLOOKUP MATCH INDEX INDEX + MATCH XLOOKUP


Lookup Searches Searches Searches vertically Returns a value Combines MATCH Searches vertically or
Direction vertically horizontally or horizontally from a specified (search) with horizontally
(column-wise) (row-wise) row/column INDEX (fetch)
Syntax =VLOOKUP(lo =HLOOKUP(l =MATCH(lookup_va =INDEX(array, =INDEX(table_arra =XLOOKUP(lookup_val
okup_value, ookup_value lue, lookup_array, row_num, y, ue, lookup_array,
table_array, , table_array, [match_type]) [column_num]) MATCH(lookup_val return_array,
col_index_nu row_index_ ue, [if_not_found],
m, num, lookup_column, 0), [match_mode],
[range_lookup [range_look MATCH(lookup_val [search_mode])
]) up]) ue, lookup_row, 0))
Example Finding a Finding a Finding the position Retrieving a Finding a product Finding employee
Usage price of a student's of a student's roll student's name price dynamically salary based on ID
product based score in number using row and in a large dataset instantly
on ID different column indices
subjects
Use Case When data is When data When you need the When you need When VLOOKUP is Most advanced lookup
structured in is structured position of a value to extract data too limited function in Excel
columns in rows from a specific
position
Returns A single value A single The position A value from a A value from a A value from a column
from a value from a (row/column specified row specified row and or row, like VLOOKUP
specific specific row number) of a value and column column but better
column dynamically
Works with Yes, needs Yes, needs No, only returns Yes, can extract Yes, can extract Yes, supports multiple
Columns/Ran column row positions values from any values from any search conditions
ges? numbers numbers range range
Approximate Yes Yes Yes (1, 0, -1) No Yes (via MATCH Yes (customizable
Match? (TRUE/FALSE) (TRUE/FALSE function) match modes)
)
Supports Left No (only right No (only Yes Yes Yes Yes (can search left
Lookup? lookup) down and right)
lookup)
Supports No No Yes Yes Yes Yes
Dynamic
Arrays?
Works with No No No No Yes Yes (best function for
Multiple this)
Criteria?
Performance Slower on Slower on Fast Fast Faster than Fastest
large datasets large VLOOKUP
datasets

28. Explain the difference between the TODAY() and NOW() functions.
Ans:
TODAY() returns the current date without time.
NOW() returns both the current date and time.
29. What are the most commonly used date and time functions in Excel?
Ans:
Function Description Example Output
TODAY() Returns the current date =TODAY() 14-Mar-2025
NOW() Returns current date and time =NOW() 14-Mar-2025 10:15 AM
DAY() Extracts the day from a date =DAY(A1) 14
MONTH() Extracts the month from a date =MONTH(A1) 3
YEAR() Extracts the year from a date =YEAR(A1) 2025
DATEDIF() Calculates the difference =DATEDIF(A1, B1, "Y") Number of years
between two dates
30. What are the key text functions used in Excel? Provide examples.
Ans:

Function Purpose Example Output


LEFT() Extracts characters from =LEFT("Excel", 2) Ex
the beginning
RIGHT() Extracts characters from =RIGHT("Excel", 2) el
the end
MID() Extracts characters from =MID("Excel", 2, 2) xc
the middle
LEN() Returns the length of text =LEN("Excel") 5
CONCATE Joins text strings =CONCATENATE("Hello", Hello
NATE() " World") World
TEXT() Formats numbers as text =TEXT(1234, "00000") 01234

31. What is the PMT function? How is it used in loan calculations?


Ans: The PMT function calculates the monthly payment for a loan based on a constant interest rate and fixed number of payments.
Syntax: =PMT(rate, nper, pv, [fv], [type])
o rate => Interest rate per period
o nper => Number of periods
o pv => Present value (loan amount)
o fv (optional) => Future value (default is 0)
o type (optional) => 0 for end-of-period payments, 1 for beginning
For Example: =PMT(10%/12, 90, -100000)
Returns the monthly payment for a ₹1,00,000 loan at 10% annual interest for 90 months.
32. How can you calculate the difference between two dates in years, months, and days?
Ans: You can use the DATEDIF function to calculate the difference in years, months, and days.
Syntax: =DATEDIF(start_date, end_date, unit)
Where,

Unit Description

"Y" Number of complete years

"M" Number of complete months

"D" Number of days

"MD" Days excluding months and


years

"YM" Months excluding years

"YD" Days excluding years


Example : =DATEDIF("01-Jan-2000", "01-Mar-2025", "Y") & " Years, " & DATEDIF("01-Jan-2000", "01-Mar-2025", "YM") & " Months"
OUTPUT : 25 Years, 2 Months
33. How can you extract the first and last name from a full name in ExceL?
Ans: To extract the first name and last name from Full Name in column A, use:

Extracting First Name:


=LEFT(A2, FIND(" ", A2)-1)

Extracting Last Name:

=RIGHT(A2, LEN(A2)-FIND(" ", A2))


34. What is the difference between COUNT, COUNTA, and COUNTIF?
Ans:

Function Description Example

COUNT Counts only numeric values =COUNT(A1:A10)

COUNTA Counts both text and numeric values =COUNTA(A1:A10)

COUNTIF Counts based on a condition =COUNTIF(A1:A10, ">50")

35. What is an array formula? How is it used in Excel?


Ans: An array formula performs multiple calculations in a single formula. To calculate the Sum of Product use this following formula
=SUM(A1:A5 * B1:B5)
Press Ctrl + Shift + Enter to apply.
36. What are the benefits of using VLOOKUP with tables instead of a regular range?
Ans: Using Excel Tables with VLOOKUP has several advantages:
• Dynamic Range: In a regular range, the data range is fixed (e.g., A2:B10), meaning you need to manually adjust the range if new data is
added. In an Excel table, the range automatically expands when new data is added, making formulas more flexible.
• Named References: Regular ranges use absolute references like A2:B10, whereas Excel tables use structured references like
Table1[Column1], which makes it easier to read and maintain formulas.
• Readability: Regular ranges can become difficult to manage in large datasets, while Excel tables improve readability by using structured
references that make formulas clearer.
• Example of VLOOKUP in Regular Range: =VLOOKUP(101, A2:B10, 2, 0). Here, 101 is searched in column A within the range A2:B10,
and the corresponding value from column 2 is returned.
• Example of VLOOKUP in an Excel Table: =VLOOKUP(101, Table1, 2, 0). Instead of a static range, the lookup is performed within Table1,
which dynamically updates as data is added or removed. This makes the formula more adaptable and prevents errors caused by missing
data.

You might also like