Solved

excel fomula

Posted on 2013-05-16
13
224 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

808 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