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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,215,465
Messages
6,124,975
Members
449,200
Latest member
Jamil ahmed

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