IF AND Formula help

herpasymplex10

Board Regular
Joined
May 26, 2005
Messages
224
I think this is possible, but i could be wrong.
I've got a formula

=IF(AND(F2="F",D2="PAP"),L2,"")

What i'd like is for the formula to look at just the last letter of the three letter code in D2
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try this out:

=IF(AND(F2="F",right(D2,1)="P"),L2,"")

Basically, this will say if the value in F2 = "F" and the last letter in D2 = P, then it will return the value in L2... otherwise it will remain blank.

Jonmo1 beat me to it!
 
Upvote 0
thanks for such quick replies
unfortunately i jumped the gun on my post

I need it to look at the last two letters from D2
if they are "AP" then return the value of L2

I appreciate the help
i'm sick and my mind is not working today

would it be this?

right(D2,2)="AP"
 
Last edited:
Upvote 0
=IF(AND(F2="F",right(D2,2)="AP"),L2,"")
 
Upvote 0
again. i spoke to soon
i'm having trouble adding an OR statement to the formula
F2 could be either "F" or "M"
for the statement to be true
help?
 
Upvote 0
=IF(AND(OR(F2="F",F2="M"),right(D2,2)="AP"),L2,"")
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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