FormulaCraft

How to combine IF and AND in Excel and Google Sheets

Topic:IF, IFS & nested conditions
Excel & Google Sheets
=IF(AND(A2>0,B2>0),"Both Positive","Not Both Positive")

Verified example

Computed by a real spreadsheet engine on the sample data below.

Value AValue BResult
510
-38
7-2
46

=IF(AND(A2>0,B2>0),"Both Positive","Not Both Positive")Both Positive

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Write all conditions you need to be simultaneously true as arguments inside AND(): AND(condition1, condition2, …).
  2. 2Use the AND() as the logical_test of IF: =IF(AND(A2>0,B2>0),"Both Positive","Not Both Positive").
  3. 3Press Enter. The formula returns the first value only when every AND condition is TRUE; otherwise it returns the else value.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Can I use IF AND to check text as well as numbers?

Yes. Conditions work with text, numbers, or dates: AND(A2="Yes",B2>100,C2<>"Exclude") is perfectly valid.

What happens if one of the cells in an AND condition is empty?

An empty cell evaluates to 0 or FALSE depending on context. A condition like A2>0 will be FALSE for an empty cell.

More on IF, IFS & nested conditions

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: