Thread: If function?
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rajah Rajah is offline
external usenet poster
 
Posts: 6
Default If function?

If you want to extract the leftmost part, before the dash, you might
try these two functions.

in B1:
=SEARCH(" - ", A1)

That puts a 6 in B1, which is the position of the dash.

in C1:
=LEFT(A1, B1)

That puts "Stock" in C1, which is the leftmost portion of A1 until the
dash.

(When you're happy with the first line, you should copy these to the
second and subsequent lines with the Fill Down command.)

You may also combine these into one nested function:
=LEFT(A1, SEARCH(" - ", A1))

The way you can find these nifty functions is clicking on the "fx"
probably above the "B" column header. You can enter a description of
what you're looking for or just pick the Text category.