if statement with two conditions

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
618
Office Version
  1. 365
Platform
  1. Windows
Hi
I'm can't seem to get this to work. I keep getting a return of "false"
VBA Code:
=IF(AND(B46="yes",+F44),IF(B46="no",+F45),"")
I'm trying to keep the cell blank if b46 is blank

sorry if i'm using the wrong icon to make it easier to see th if statement
mike
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

mehidy1437

Active Member
Joined
Nov 15, 2019
Messages
270
Office Version
  1. 2013
Platform
  1. Windows
  2. Mobile
  3. Web
What are trying to do? Your statment is not clear.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,396
Office Version
  1. 365
Platform
  1. MacOS
you are missing a FALSE in the 2nd IF

IS this VBA or a formula

=IF(AND(B46="yes",+F44),IF(B46="no",+F45),"")
=IF( TEST, TRUE, FALSE)
=IF( TEST, IF( TEST , TRUE, FALSE), FALSE)

IF B46 = YES and so TRUE - then when you got to the TRUE section
IF(B46="no",+F45
Then B46 cannot be NO, as to get to that TRUE part B46 = YES
not sure what the +F44 means in the AND
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
11,942
Office Version
  1. 365
Platform
  1. Windows
Maybe

=IF(B46="yes",F44),IF(B46="no",F45,""))
 

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
618
Office Version
  1. 365
Platform
  1. Windows
Hi
I see the mistake.
Thanks for the replies mehidy1437 and *hureechunder
I'm going to blame it on the Virus

Mike
 

Watch MrExcel Video

Forum statistics

Threads
1,122,569
Messages
5,596,915
Members
414,110
Latest member
docops

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