Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Get section of text from cell

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Get section of text from cell

=IF(ISERROR(LEFT(a1,FIND(",",a1)-1)),"",LEFT(a1,FIND(",",a1)-1))

This will find the first comma and return everything in front of it. If
there is an error (comma not found, or is 1st digit, cell will remain blank)


--
Best Regards,

Luke M


"Kees Vos" wrote:

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Get section of text from cell

Thanks Luke for your help.
Unfortunately it does not work completely. It looks like the formula FIND
only searches for the entire text and not a section of text, therefore it
won't have any results if you search for a section of the text (in this case
, ). Is there something to get anything like a contain search order?

--
Kees Vos


"Luke M" wrote:

=IF(ISERROR(LEFT(a1,FIND(",",a1)-1)),"",LEFT(a1,FIND(",",a1)-1))

This will find the first comma and return everything in front of it. If
there is an error (comma not found, or is 1st digit, cell will remain blank)


--
Best Regards,

Luke M


"Kees Vos" wrote:

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Get section of text from cell

I'm not sure I understand. The FIND command is only looking for the comma.
Nothing else. It then returns a number(place number). The LEFT commands takes
all the digits up to that number, minus 1(to exclude the comma)

Could you post an example of what you are searching, and what is returned?
--
Best Regards,

Luke M


"Kees Vos" wrote:

Thanks Luke for your help.
Unfortunately it does not work completely. It looks like the formula FIND
only searches for the entire text and not a section of text, therefore it
won't have any results if you search for a section of the text (in this case
, ). Is there something to get anything like a contain search order?

--
Kees Vos


"Luke M" wrote:

=IF(ISERROR(LEFT(a1,FIND(",",a1)-1)),"",LEFT(a1,FIND(",",a1)-1))

This will find the first comma and return everything in front of it. If
there is an error (comma not found, or is 1st digit, cell will remain blank)


--
Best Regards,

Luke M


"Kees Vos" wrote:

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Get section of text from cell

I have to translate the formulas since i work in a Dutch version. But I think
the problem shows when i use this formula: FIND(",";A1)
A1 has the text 14050001 EH, Filmkastpet Hvide RAL 1028
But the result of the formula is: #N/B

If the formula is: FIND("14050001 EH, Filmkastpet Hvide RAL 1028";A1)
The result is 14050001 EH, Filmkastpet Hvide RAL 1028, so thats good.

My conclusion is that the formula FIND only searches for the enitre content.

Hope this is clear. Thanks anyway!
--
Kees Vos


"Luke M" wrote:

I'm not sure I understand. The FIND command is only looking for the comma.
Nothing else. It then returns a number(place number). The LEFT commands takes
all the digits up to that number, minus 1(to exclude the comma)

Could you post an example of what you are searching, and what is returned?
--
Best Regards,

Luke M


"Kees Vos" wrote:

Thanks Luke for your help.
Unfortunately it does not work completely. It looks like the formula FIND
only searches for the entire text and not a section of text, therefore it
won't have any results if you search for a section of the text (in this case
, ). Is there something to get anything like a contain search order?

--
Kees Vos


"Luke M" wrote:

=IF(ISERROR(LEFT(a1,FIND(",",a1)-1)),"",LEFT(a1,FIND(",",a1)-1))

This will find the first comma and return everything in front of it. If
there is an error (comma not found, or is 1st digit, cell will remain blank)


--
Best Regards,

Luke M


"Kees Vos" wrote:

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Get section of text from cell

Aaaah, I changed my language of Excel to English (wonderfully all the
formula's are translated! :D) and found out that I used LOOKUP in stead of
FIND. Changed it to FIND and now it works! Superr!

Thanks a lot!

--
Kees Vos


"Luke M" wrote:

I'm not sure I understand. The FIND command is only looking for the comma.
Nothing else. It then returns a number(place number). The LEFT commands takes
all the digits up to that number, minus 1(to exclude the comma)

Could you post an example of what you are searching, and what is returned?
--
Best Regards,

Luke M


"Kees Vos" wrote:

Thanks Luke for your help.
Unfortunately it does not work completely. It looks like the formula FIND
only searches for the entire text and not a section of text, therefore it
won't have any results if you search for a section of the text (in this case
, ). Is there something to get anything like a contain search order?

--
Kees Vos


"Luke M" wrote:

=IF(ISERROR(LEFT(a1,FIND(",",a1)-1)),"",LEFT(a1,FIND(",",a1)-1))

This will find the first comma and return everything in front of it. If
there is an error (comma not found, or is 1st digit, cell will remain blank)


--
Best Regards,

Luke M


"Kees Vos" wrote:

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Get section of text from cell

Hurrah! Glad we could solve it. Thanks for feedback.
--
Best Regards,

Luke M


"Kees Vos" wrote:

Aaaah, I changed my language of Excel to English (wonderfully all the
formula's are translated! :D) and found out that I used LOOKUP in stead of
FIND. Changed it to FIND and now it works! Superr!

Thanks a lot!

--
Kees Vos


"Luke M" wrote:

I'm not sure I understand. The FIND command is only looking for the comma.
Nothing else. It then returns a number(place number). The LEFT commands takes
all the digits up to that number, minus 1(to exclude the comma)

Could you post an example of what you are searching, and what is returned?
--
Best Regards,

Luke M


"Kees Vos" wrote:

Thanks Luke for your help.
Unfortunately it does not work completely. It looks like the formula FIND
only searches for the entire text and not a section of text, therefore it
won't have any results if you search for a section of the text (in this case
, ). Is there something to get anything like a contain search order?

--
Kees Vos


"Luke M" wrote:

=IF(ISERROR(LEFT(a1,FIND(",",a1)-1)),"",LEFT(a1,FIND(",",a1)-1))

This will find the first comma and return everything in front of it. If
there is an error (comma not found, or is 1st digit, cell will remain blank)


--
Best Regards,

Luke M


"Kees Vos" wrote:

Hey,

A long row of cells contains a item number and a item name, something like
this:
123456, item name
I only need the item number as a result. Is there a way to extract only the
text in front of a seperation mark (in this case the , )?

Note, the item number can contain numbers and/or letters and a interspace.

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrap text in header section Excel 2007 Ted M H Excel Discussion (Misc queries) 2 November 10th 07 06:36 PM
how do I highlight section in cell rduke57 Excel Discussion (Misc queries) 1 April 27th 07 05:34 PM
How do I print just the section a through f only? Colors New Users to Excel 3 September 4th 06 09:08 AM
Converting selected section of text to numbers Rob Excel Discussion (Misc queries) 6 March 8th 05 01:52 AM
Stripping section of text Philippe L. Balmanno Excel Worksheet Functions 3 December 30th 04 03:36 PM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"