Help with True/False Formula

McNeil87

Board Regular
Joined
Dec 6, 2019
Messages
55
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hello!

Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True, IF(AH2=TRUE,TRUE,FALSE),TRUE). The result brings True, but it actually needs to be False (for this specific case). Am I missing a 'False' statement after the first logical test? Any recommendations how I should write this would be great. All the data returns True, and that is not correct.

Thank you!
 

Attachments

  • 2019-12-09_15h33_55.png
    2019-12-09_15h33_55.png
    33.2 KB · Views: 21

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Maybe this

VBA Code:
=IF(AND(AG2=TRUE, AH2=TRUE),TRUE,FALSE)
 
Upvote 0
Thank you. Can you explain what break this down? Does this mean, IF AG2=True, and AH2=True, then return 'True', Else ' false'? The ANd statement returns will return true if both criteria are true, correct?
 
Upvote 0
Yes, you are correct.
If either / neither are TRUE then it will return FALSE
 
Upvote 0
I think you are all tangled up with Boolean logic. You are saying what your formula should return, but you do not tell us the values for AG or AH, or why you think this formula should return FALSE.

First of all let's look at this expression within your formula:
AG=TRUE
So AG must be TRUE or FALSE. If it is TRUE, you want the result of this comparison to be TRUE. That is exactly the same as just
AG

Similarly,
IF(AH=TRUE,TRUE,FALSE)
gives the same result as just
AH

Judging from your screenshot, your formula is
=IF(AG2=TRUE,IF(AH=TRUE,TRUE,FALSE),TRUE)

This is logically equivalent to
=IF(AG,AH,TRUE)

Now. What are the values of AG and AH? If your formula is giving you a different result than you expect, please explain the logic you want to use.

Here is the truth table for your formula:

AGAHRESULT
TRUETRUETRUE
TRUEFALSEFALSE
FALSETRUETRUE
FALSEFALSETRUE
 
Upvote 0
Cell AG is a contract , and AH is a program.. So, IF Cell AG is a contract and part of a program, then return True. If Cell AG (contract) is a contract, BUT not part of a program, then return 'False.' IF AG is not a contract, and is not part of a program, return False.
 
Upvote 0
I think you are all tangled up with Boolean logic. You are saying what your formula should return, but you do not tell us the values for AG or AH, or why you think this formula should return FALSE.

First of all let's look at this expression within your formula:
AG=TRUE
So AG must be TRUE or FALSE. If it is TRUE, you want the result of this comparison to be TRUE. That is exactly the same as just
AG

Similarly,
IF(AH=TRUE,TRUE,FALSE)
gives the same result as just
AH

Judging from your screenshot, your formula is
=IF(AG2=TRUE,IF(AH=TRUE,TRUE,FALSE),TRUE)

This is logically equivalent to
=IF(AG,AH,TRUE)

Now. What are the values of AG and AH? If your formula is giving you a different result than you expect, please explain the logic you want to use.

Here is the truth table for your formula:

AGAHRESULT
TRUETRUETRUE
TRUEFALSEFALSE
FALSETRUETRUE
FALSEFALSETRUE

Cell AG is a contract , and AH is a program.. So, IF Cell AG is a contract and part of a program, then return True. If Cell AG (contract) is a contract, BUT not part of a program, then return 'False.' IF AG is not a contract, and is not part of a program, return False.
 
Upvote 0
Cell AG is a contract , and AH is a program.. So, IF Cell AG is a contract and part of a program, then return True. If Cell AG (contract) is a contract, BUT not part of a program, then return 'False.'
I think you are all tangled up with Boolean logic. You are saying what your formula should return, but you do not tell us the values for AG or AH, or why you think this formula should return FALSE.

First of all let's look at this expression within your formula:
AG=TRUE
So AG must be TRUE or FALSE. If it is TRUE, you want the result of this comparison to be TRUE. That is exactly the same as just
AG

Similarly,
IF(AH=TRUE,TRUE,FALSE)
gives the same result as just
AH

Judging from your screenshot, your formula is
=IF(AG2=TRUE,IF(AH=TRUE,TRUE,FALSE),TRUE)

This is logically equivalent to
=IF(AG,AH,TRUE)

Now. What are the values of AG and AH? If your formula is giving you a different result than you expect, please explain the logic you want to use.

Here is the truth table for your formula:

AGAHRESULT
TRUETRUETRUE
TRUEFALSEFALSE
FALSETRUETRUE
FALSEFALSETRUE


IF AG is not a contract, and is not part of a program, return False.

Looking at your table further, your table is correct. I have both cells as a 'False' Statements, and the result needs to return true.

I am stumped.
 
Upvote 0

Forum statistics

Threads
1,213,501
Messages
6,114,010
Members
448,543
Latest member
MartinLarkin

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
Back
Top