# Returning a value from two fields

#### Yusuf

##### Active Member
Hi

Is it possible to create and IIF formula that returns a value only if both fields equal certain criteria?

Eg.
Field1 - Voluntary
Field2 - Complete

The return in the IIF formula should be the number "1"

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
iif([Field1] = "Voluntary" AND [Field2] = "Complete",1,0)

Sure, something like:

MyValue:IIF(([Field1]="Voluntary") And ([Field2]="Complete"),1,0)

Replies
6
Views
345
Replies
5
Views
504
Replies
3
Views
643
Replies
3
Views
864
Replies
9
Views
750

1,219,005
Messages
6,145,706
Members
450,635
Latest member
Rookie3510

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back