ANOTHER IF(AND Statement question

Mister H

Well-known Member
Joined
Mar 6, 2002
Messages
1,507
Hi:

As per usual I can not wrap my tiny mind around an IF(AND statement.

Here is what I have been trying to get to work:

=IF(AND(LEFT(B2,10)="Customer N",B2=B1,"Delete","")

So:

IF the first 10 characters in B2 are "Customer N"
AND IF the VALUE of B2=B1
then mark as Delete otherwise leave the cell Blank

Where did I go wrong with my formula? :confused:

THANKS to anyone that can assist :)
Mark
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hello,

Looks like a missing parentheses:

<TABLE style="WIDTH: 329pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=438><COLGROUP><COL style="WIDTH: 329pt; mso-width-source: userset; mso-width-alt: 7008" width=438><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: #eaf1dd; WIDTH: 329pt; HEIGHT: 15.75pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl63 height=21 width=438>=IF(AND(LEFT(B2,10)="Customer N",B2=B1),"Delete","")


</TD></TR></TBODY></TABLE>
 
Upvote 0
THANKS repairman615. I had tried the parenthesis but I put it at the end :)

After trying the formula it is looking like I may have to expand it a little to capture more duplicates. Is there anyway that you know of to add an OR

If LEFT(B2,10)="Customer N" OR "Balance fo"

THANKS Again for your help. It is APPRECIATED :biggrin:

Take Care,
Mark
 
Upvote 0
Hi Mark,

Like this?

<TABLE style="WIDTH: 584pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=778><COLGROUP><COL style="WIDTH: 584pt; mso-width-source: userset; mso-width-alt: 12448" width=778><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: #eaf1dd; WIDTH: 584pt; HEIGHT: 15.75pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=21 width=778>=IF(OR(AND(LEFT(B2,10)="Customer N",B2=B1),AND(LEFT(B2,10)="Balance fo",B2=B1)),"Delete","")


</TD></TR></TBODY></TABLE>
 
Upvote 0
Hi repairman615

THANKS that seems to do the trick :)

Your help is VERY APPRECIATED... :biggrin:

Have an EXCELLENT night,

Mark
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

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