Solved

excel fomula

Posted on 2013-05-16
13
210 Views
Last Modified: 2013-05-16
I need help to write the formular for ship type column.
The excel file has two columns, if the column shipper value doesn't begin with 'C-', or ' F-' or 'S-', then ship type column should be unknown, otherwise will return the first letter of Shipper column.

SHIPPER      SHIP TYPE
PAT                 unknown
C-TH                 C
F-KC                 F
S-DB                 S
........
.......

thanks,
0
Comment
Question by:HemlockPrinters
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39172429
Assuming the Shipper is in column A:

=IF(OR(LEFT(A2,2)="C-",LEFT(A2,2)="F-"LEFT(A2,2)="S-"),LEFT(A2,1),"unknown")

Kevin
0
 
LVL 23

Assisted Solution

by:NBVC
NBVC earned 200 total points
ID: 39172433
Assuming data starts in A2, try:

=IF(OR(ISNUMBER(SEARCH({"C-","F-","S-"},A2))),LEFT(A2),"unknown")

copied down
0
 
LVL 81

Assisted Solution

by:zorvek (Kevin Jones)
zorvek (Kevin Jones) earned 200 total points
ID: 39172440
More compact:

=IF(OR(LEFT(A2,2)={"C-","F-","S-"}),LEFT(A2,1),"unknown")

Kevin
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 100 total points
ID: 39172445
=IF(ISERR(FIND(LEFT(A1,2),"C-F-S-")),"unknown",LEFT(A1))
0
 
LVL 23

Assisted Solution

by:NBVC
NBVC earned 200 total points
ID: 39172453
or still more compact:

=IF(OR(LEFT(A2,2)={"C-","F-","S-"}),LEFT(A2),"unknown")
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 39172484
"Name that tune!"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39172488
Go play with Access. We're busy here.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39172494
BarryCade
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 200 total points
ID: 39172498
A more generic solution that looks for any value with a letter followed by a dash followed by two letters:

=IF(ISERR((SEARCH("?-??",A2))),"unknown",LEFT(A2))

Kevin
0
 
LVL 23

Expert Comment

by:NBVC
ID: 39172546
Hey Kevin, just bought your book with Jelen/Umlas, to give to my sister in-law... hopefully it'll get her off my back for a while ;)
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39172552
:-)
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39172556
Not Umlas, Urtis.
0
 
LVL 23

Expert Comment

by:NBVC
ID: 39172569
ooops...   :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now