Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if formula will not work 2

Status
Not open for further replies.

sdelacey

Vendor
Jul 2, 2003
12
GB
hi guys

Can anybody help. I am trying to write a formula that will copy a cell if the 4th char is /. I have written =IF(LEFT(B2,4)="/",""), but it does not seem to work. Can you please help me by telling me where I have gone wrong.

Cheers

Steph
 
=IF(MID(B2,4,1)="/","")

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
sorry, hit submit before explaining:

If B2 is say abc/def

LEFT(B2,4) will give you abc/

MID(B2,4,1) will give you /

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
The problem with the statement is you are setting the value to "" if it passes the test. An if statement like that reads =IF(test,value if true, value if false), your formula shouls be =IF(LEFT(B2,4)="/",B2,"")
 
Sorry got ahead myself as well is should be
=IF(MID(B2,4,1)="/",B2,"")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top