Formula not evaluating as expected

Foo_Man_Chu

Board Regular
Joined
Jul 22, 2010
Messages
79
I have this formula:

Code:
=IF(AND(B1="HERE",LEFT(D3,7)="STC|A2:"),C3="HERE","")

It didn't return the expected result of C3 = "HERE" so I evaluated it. For some reason these two parts of the formula evaluate to TRUE:


Code:
AND(B1="HERE",LEFT(D3,7)="STC|A2:")

but overall the formula evaluates to false. I know this isn't that hard of a formula but I'm completely stumped. Can someone help me out please? Thanks in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Are you testing to see if C3 = "HERE" or that's what you want it to equal under a certain condition? A formula can only return a value in C3 if it's written in C3.

=IF(AND(B1="HERE",LEFT(D3,7)="STC|A2:",C3="HERE"),"")

otherwise:

=IF(AND(B1="HERE",LEFT(D3,7)="STC|A2:"),"HERE","")
 
Last edited:
Upvote 0
Formulas return a result to the cell in which they appear.

=IF(AND(B1="HERE",LEFT(D3,7)="STC|A2:"),"HERE","")
 
Upvote 0
You are getting False because after the "AND" comes back as true you are doing another evaluation of C3="Here", and that is what is giving you the FALSE.

If you are trying to populate cell C3 with the word "Here" using this IF statement then you need to put the formula into cell C3, you don't need to call it out. So if you put this in C3 what do you get, is it what you want?

Code:
[COLOR=#333333]=IF(AND(B1="HERE",LEFT(D3,7)="STC|A2:"),"HERE","")[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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