+ Reply to Thread
Results 1 to 13 of 13

formula for separate number from Text

  1. #1
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    formula for separate number from Text

    I have in a column various text arrays. In those arrays you will find E-Numbers like E270. Those E-Numbers I want to have in the column next to it separated. Can you create an Excel formula for this?

    Example text in one cell:
    Rapsöl, Ziegen-/ KuhMilch-Frischkäsezubereitung 29% (ZiegenMilch[Niederlande], Kuhmilch [Deutschland], Kochsalz, Olivenöl, Wasser, Säuerungsmittel [E 270], modifizierte Maisstärke [E 1422], Pfeffer, Knoblauch), Paprikaschoten, Kochsalz, Säuerungsmittel (E 330, E 260), Festigungsmittel (E 509).

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formula for separate number from Text

    what is your expected result first E270 or all Numbers with E
    then is your data will be in same setup as it is shown here
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: formula for separate number from Text

    Assuming text is in A1:

    Please Login or Register  to view this content.
    Drag across till getting "E0"

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: formula for separate number from Text

    This Data is in Cell A1:
    Rapsöl, Ziegen-/ KuhMilch-Frischkäsezubereitung 29% (ZiegenMilch[Niederlande], Kuhmilch [Deutschland], Kochsalz, Olivenöl, Wasser, Säuerungsmittel [E 270], modifizierte Maisstärke [E 1422], Pfeffer, Knoblauch), Paprikaschoten, Kochsalz, Säuerungsmittel (E 330, E 260), Festigungsmittel (E 509).

    What I Need:
    I need to Extract all E number to cell B1 like you can see on Cell A1 E 270, E 1422, E 330, E 260, E509

  5. #5
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: formula for separate number from Text

    Bebo02199 thanks for reply you given formula is find only E 270, I need all E number in Column A.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formula for separate number from Text

    First of all bebo's formula works well
    another approach may be copy paste below in B1 then hold control and shift together and then hit enter to make it array formula and drag to right
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Third to extract all in column B1 you need to use VBA




    Array formulas are...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  7. #7
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: formula for separate number from Text

    can you send me VBA code.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: formula for separate number from Text

    Please Login or Register  to view this content.


    With Text in A1 , in B1: =Find_E(A1)

  9. #9
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: formula for separate number from Text

    With Text in A1 , in B1: =Find_E(A1) ?

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: formula for separate number from Text

    Put this in B1 "=Find_E(A1)" (without the quotes)


    "Find_E" is the VBA function provided
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: formula for separate number from Text

    wow, its working so perfect, Thank you very much

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: formula for separate number from Text

    If your query has been answered, please mark thread as "solved" ("Thread Tools" at top of first post)

  13. #13
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: formula for separate number from Text

    Hi Farhan,

    Following on from your PM request and my suggestions, glad to see you got some great help here.
    You were able to explain your problem much better!

    It would be courteous to put a link to similar Threads you are posting
    http://www.excelforum.com/excel-prog...-column-b.html
    http://www.excelforum.com/excel-form...from-text.html
    That way the Helpers are less likely to Duplicate work.

    ( Note also please for future reference and read please Forum Rules
    http://www.excelforum.com/forum-rule...rum-rules.html
    especially please read for future reference:
    Rule 4. Don't Private Message or email Excel questions to moderators or other members.
    And
    Rule 5. Don't duplicate threads )
    ( and Rule 1. 1. Use concise, accurate thread titles – you made a big improvement there! )

    _ .....................................................
    But no harm done this time as you are still very new here, : Glad you got some great help with many alternatives. It made it all great to learn in seeing the alternatives from so many people!!

    BTW. Note again what both bebo021999 and hemesh said
    ‚……Array formulas are...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer….“

    Their formulas all worked great! ( I have implemented them for you in the enclosed File, putting those CSE Type 1 formulas in manually - ), ( - The only difficulty i am still investigating is that I was unable to use VBA to put those formulas in using .FormulaArray = ***** )

    Hope that is all a good contribution
    Alan


    Enclosed: ( Attached ) A Summary File I used while learning from these two posts
    See Sheet “farhangulNährwerteE“ and Sheet Code Module for the CSE Formulas implementation and my ( failed ***** ) attempt at putting them in with code )
    And Normal Macro Module: „PubsUDFs“ for the 3 given Functions
    ( I will update this file as I learn and understand more of it, and in particular RegEx stuff... )
    File “BrentacvegasjindonRegexFahan.xlsm”
    https://app.box.com/s/5wgwb14vv6thu5v02douh9r2nsglnohf




    Referrences
    _a) http://www.excelforum.com/excel-new-...ml#post4290062
    _b ) http://stackoverflow.com/questions/2...cell-and-loops

    _c) I liked this, sorry i lost the reference
    “.......If you can solve your problem without regular expressions (just by string functions), you don't use regular expressions. As it was said in one book I've read: regular expressions are violence over computer.
    ...”.
    _d) Formula translator
    http://www.excel-ticker.de/excel-formel-uebersetzer/
    _e) Misc...
    http://excelmatters.com/2015/03/17/on-error-wtf/
    https://app.box.com/s/8zkhjcmbxrqnlnexqpktuy41clgqm4zo


    Thanks all again, great learning experience along with the other alternatives.
    Alan.


    And as last.... here is another Function ( and test calling code ) along the line of jindon’s
    Copy all Code to a Normal Macro Code Module
    Type in a cell
    =ENummern(A1) ( or =ENummern(A35).... etc ) where Cell A1 ( or Cell A35) has your string of ingredients in it enit )

    Code:

    Please Login or Register  to view this content.
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel2010 IF Formula to return value based on a separate date and two separate text values
    By jakecutler in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2015, 03:24 AM
  2. [SOLVED] How to separate text from numbers (no fixed number pattern)
    By harelk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-26-2014, 03:27 AM
  3. Separate number from text
    By sriku in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2014, 10:09 AM
  4. Separate Text & Number
    By jpeifer03 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-13-2014, 05:22 PM
  5. How do I separate text from a phone number in one cell?
    By watchoverme in forum Excel General
    Replies: 21
    Last Post: 01-12-2014, 05:32 PM
  6. [SOLVED] Formula to separate number from text
    By alcharbonneau in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-26-2013, 06:13 PM
  7. [SOLVED] separate text, number
    By marreco in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2012, 09:09 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1