If, then formula

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do I create a formula to express the following:
if T4=N, then V4=N,but
if T4=Y and AE4 does not equal 3, then V4=Y, but
if T4=Y and AE4=3, then V4=N
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
Hi there,

How about ..

=IF((T4="Y")*(AE4=3),"N",IF(TF="Y","Y",IF(TF="N","N","No Criteria Set")))
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
This gives me a result of #NAME?, when the result should be "N", probably because of the TF in the formula:
=IF((T4="Y")*(AE4=3),"N",IF(TF="Y","Y",IF(TF="N","N","No Criteria Set")))
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,407
Office Version
  1. 365
Platform
  1. Windows
Brew

You could try:
=IF(OR(T4="N",AE4=3),"N","Y")
though you haven't said what you want to happen if T4 is not Y or N.
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows

ADVERTISEMENT

Perhaps:

=IF(AE4=3,"N",T(T4))
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
Thanks Peter. T4 is always Y or N. This solutions works fine
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569

ADVERTISEMENT

Wow, Hotpepper, this solution is very concise and works. Thanks
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,407
Office Version
  1. 365
Platform
  1. Windows
T4 is always Y or N.
Wow, Hotpepper, this solution is very concise and works. Thanks
Given the first quote and HOTPEPPER's concise solution, why not go one step further (or is it one step less)?
=IF(AE4=3,"N",T4)
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I had that originally, but it returns a 0 if T4 is blank.
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
yep, that is a working solution, because it will always be either a Y or N in the cell.
 

Forum statistics

Threads
1,136,268
Messages
5,674,734
Members
419,523
Latest member
Urnovio

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

Which adblocker are you using?

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
Top