Using IF only when certain text is in the cell

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
306
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm trying to tailor the IF command to put "SP" in a cell only if the referenced cell has FS in front of the number (i.e. FS101RR). FS will only be at the beginning of the entry, but isn't always there. What I've got isn't working which no doubt means it's not right. If there's not an FS in the referenced cell I want the target cell to be blank so I just put a space between two quotes. Can anybody help me figure out how to fix this? I know there's a way, but I just can't figure it out at the moment...

=IF(CSV!Z3=LEFT("FS",2)),"SP"," ")
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You are applying the LEFT function to your hard-coded string and not your cell.
Try:
Code:
[COLOR=#333333]=IF(LEFT(CSV!Z3,2)="FS","SP","")[/COLOR]
I want the target cell to be blank so I just put a space between two quotes.
Note that a single space is NOT the same as a blank entry. Use two double-quotes with NO spaces in between.
 
Last edited:
Upvote 0
Try
Code:
=IF(LEFT(CSV!Z3,2)="FP","SP","")
 
Upvote 0
FABULOUS!~ Thank you! I appreciate the help!
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,794
Members
449,468
Latest member
AGreen17

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