Cellgrids Cellgrids
Home › Practice questions › AND › Question 6

Excel AND Practice Question: Multiply price and quantity only if both are valid numbers and the quantity is…

By Rinkesh Shah, founder of Cellgrids.

The question

Multiply price and quantity only if both are valid numbers and the quantity is above 0. Otherwise write Check. Put it in C2 to C4.

The data

ABC
1PriceQtyTotal
2503?
375x?
440-2?

The yellow cells are where your answer goes.

Show answer

Expected results:

  • C2 = 150
  • C3 = Check
  • C4 = Check

How it works

Explanation: AND is used to protect the calculation. Only when the price and quantity are real numbers and the quantity is positive, the multiplication happens.
Syntax: =IF(AND(ISNUMBER(A2),ISNUMBER(B2),B2>0),A2*B2,"Check")
50 and 3 are valid, so 150. The quantity x is not a number, so Check. The quantity -2 is not above 0, so Check.

Try it yourself in the live sheet

Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.

Try this question in the live sheet →

AND syntax

=AND(logical1, [logical2], ...)

Returns TRUE only if every condition given is true. AND is used to build decision rules directly into a spreadsheet instead of manually judging each row. Full AND guide.

More AND practice questions

All practice questions · Excel exercises · Interview prep · Cheat sheet