๐ Excel Interview Questions with Answers โ Part 4
31. How do you use VLOOKUP and what are its limitations?
VLOOKUP searches for a value in the first column of a table and returns a value from another column.
Syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
Example:
=VLOOKUP(A2,D2:F10,3,FALSE)
Meaning:
โข Search value in A2
โข Look in table D2:F10
โข Return value from 3rd column
โข FALSE = exact match
๐ Example: Find employee salary using employee ID.
Limitations of VLOOKUP:
โ Searches only left to right
โ Column number must be counted manually
โ Breaks if columns are inserted/deleted
โ Slower on very large datasets
โ
Modern alternative: XLOOKUP or INDEX + MATCH
32. How do you use HLOOKUP?
HLOOKUP searches horizontally across rows.
Syntax:
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Example:
=HLOOKUP("Jan",A1:F3,2,FALSE)
๐ This searches for "Jan" in the first row and returns data from the second row.
Use Case:
Monthly reports where months are arranged horizontally.
33. How do you use INDEX + MATCH for flexible lookups?
INDEX + MATCH is more flexible and powerful than VLOOKUP.
MATCH
Finds position of a value.
=MATCH(A2,D2:D10,0)
INDEX
Returns value from a position.
=INDEX(E2:E10,3)
Combined Formula:
=INDEX(E2:E10,MATCH(A2,D2:D10,0))
๐ Example: Lookup salary using employee ID.
Advantages:
โ
Can lookup left or right
โ
More dynamic
โ
Safer when columns change
โ
Faster on large datasets
34. How do you use XLOOKUP (if available)?
XLOOKUP is the modern replacement for VLOOKUP.
Syntax:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])
Example:
=XLOOKUP(A2,D2:D10,E2:E10,"Not Found")
๐ Searches employee ID and returns salary.
Advantages:
โ
Searches both directions
โ
No column counting
โ
Built-in error handling
โ
Easier syntax
โ
More efficient
35. How do you use IF with AND / OR conditions?
AND
Returns TRUE only if all conditions are true.
Example:
=IF(AND(A1>=50,B1>=50),"Pass","Fail")
๐ Student passes only if both subjects are above 50.
OR
Returns TRUE if any condition is true.
Example:
=IF(OR(A1>=90,B1>=90),"Bonus","No Bonus")
๐ Bonus given if any score exceeds 90.
36. How do you use SUMIF, SUMIFS for conditional sums?
SUMIF
Adds values based on one condition.
Syntax:
=SUMIF(range,criteria,sum_range)
Example:
=SUMIF(A:A,"East",B:B)
๐ Sums sales only for East region.
SUMIFS
Handles multiple conditions.
Example:
=SUMIFS(C:C,A:A,"East",B:B,"Laptop")
๐ Sums laptop sales in East region.
37. How do you use COUNTIF, COUNTIFS for conditional counts?
COUNTIF
Counts cells matching one condition.
=COUNTIF(A:A,"Yes")
๐ Counts all โYesโ entries.
COUNTIFS
Counts using multiple conditions.
=COUNTIFS(A:A,"East",B:B,"Laptop")
๐ Counts laptop orders in East region.
38. How do you use AVERAGEIF, AVERAGEIFS?
AVERAGEIF
Calculates average based on one condition.
=AVERAGEIF(A:A,"East",B:B)
๐ Average sales in East region.
AVERAGEIFS
Uses multiple conditions.
=AVERAGEIFS(C:C,A:A,"East",B:B,"Laptop")
๐ Average laptop sales in East region.
39. How do you use COUNTBLANK, COUNTUNIQUE-style techniques?
COUNTBLANK
Counts empty cells.
=COUNTBLANK(A1:A20)
๐ Useful for finding missing data.
Count Unique Values (Older Excel):
=SUM(1/COUNTIF(A1:A10,A1:A10))
Modern Excel:
=COUNTA(UNIQUE(A1:A10))
๐ Counts unique customers/products/etc.
40. How do you use SUMPRODUCT for weighted calculations?
SUMPRODUCT multiplies arrays and returns the total.
Basic Example:
=SUMPRODUCT(A1:A5,B1:B5)
๐ Multiplies corresponding values and sums them.
Weighted Average Formula:
Weighted Average = SUM(xแตข * wแตข) / SUM(wแตข)
Double Tap โค๏ธ For Part-5
Post #2075
5.85K
- โค 23