Share via

I need some help creating the formula to extract data from a CSV data file

JoePerp 0 Reputation points
2026-05-10T05:00:18.8833333+00:00

The CSV file produces the sample 2 lines of data User's image

I need a formula that will populate the following columns:

Number Temp Number Type

2 R

1 M 1 Veg

Microsoft 365 and Office | Excel | Other | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-05-10T05:00:30.1633333+00:00

    Given a text like

    • 2 x Rare Filet with Lobster
    • 1 x Medium Filet with Lobster, 1 x Vegetarian

    in cell A2, the following formulas can be used to populate the columns:

    1. First Number (before the first " x ")

    =VALUE(LEFT(A2,FIND(" x ",A2)-1))
    

    2. First Temperature letter (R/M/etc.)

    =LEFT(MID(A2,FIND(" ",A2)+1,20),1)
    

    This takes the first letter of the first word after the initial number (R for Rare, M for Medium).

    3. Second Number (if present, after the comma)

    =IFERROR(
        VALUE(MID(A2,FIND(",",A2)+2,FIND(" x",A2,FIND(",",A2)+1)-FIND(",",A2)-2)),
        ""
    )
    

    If there is no second item, this returns blank.

    4. Second Type (e.g., Veg)

    =IFERROR(
        LEFT(TRIM(MID(A2,FIND(",",A2)+1,50)),3),
        ""
    )
    

    This returns the first three letters of the second item description (Veg from Vegetarian).

    Adjust cell references as needed for the actual data range and copy the formulas down.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.