# Combining 2 conditions into one formula

#### Brew

##### Well-known Member
How do I express the following as a single formula:

If J2=15,17,19,21,23,25,27 and Q2=1, then 1, if false, then 0

### Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

#### Andrew Poulsom

##### MrExcel MVP
How about?

=AND(ISNUMBER(MATCH(J2,{15,17,19,21,23,25,27},FALSE)),Q2=1)+0

#### Lewiy

##### Well-known Member
Try this:
Code:
``=AND(J2>=15,J2<=27,MOD(J2-1,2)=0,Q2=1)+0``

Thank you!!!

Replies
3
Views
342
Replies
2
Views
289
Replies
5
Views
408
Replies
6
Views
489
Replies
8
Views
137

Threads
1,190,945
Messages
5,983,797
Members
439,859
Latest member
AlunM

### 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.
Allow Ads at MrExcel

### Disable AdBlock

Follow these easy steps to disable AdBlock

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

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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