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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
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

herpasymplex10

Board Regular
Joined
May 26, 2005
Messages
224
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

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
=IF(AND(F2="F",right(D2,2)="AP"),L2,"")
 
Upvote 0

herpasymplex10

Board Regular
Joined
May 26, 2005
Messages
224
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

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
=IF(AND(OR(F2="F",F2="M"),right(D2,2)="AP"),L2,"")
 
Upvote 0

Forum statistics

Threads
1,191,117
Messages
5,984,741
Members
439,906
Latest member
Sekiro1899

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