Solved

excel fomula

Posted on 2013-05-16
13
198 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

707 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

18 Experts available now in Live!

Get 1:1 Help Now