How can I pull the text before a certain set of characters?

likesmart
Posting as :
works at
You are currently posting as works at

Assuming it's the same set of characters throughout

=left(refcell, search("characters", refcell)+-1)

I forget if the plus/minus 1 is entirely necessary though, can play around with it

likehelpful

Use a combination of mid,find and left. Find the second comma, find mg and pull everything in between

likehelpful

I’ve found examples on how to pull words and specific number of characters, but in my case that’s variable, and I’m looking to pull all the text that is ATTACHED (i.e: no spaces) to the characters I’m inputting

Specifically I’m working with a pharma database of several hundred thousand rows, and I want to make a column with the mg concentrations. The drug column is something akin to [Medicine name, capsules, 50mg x 30). I’m looking to pull the “50” or “50mg” into a separate, column. I can’t just pull the preceding 2 characters, since the concentration can also have 3+ characters (250mg, 2.5mg).

helpful

Excel may not be the best tool, I would use power query, sql, or tableau prep. To do it in excel, I think you can use a search function to find the comma, and wrap that in a left, mid or right function to grab the information you need. Lmk if you want me to try to write the formula out

helpful

Some combination of the wildcard characters may help:

Post Photo
helpful

Try this (O8 being the cell with the information in) =TRIM(MID(SUBSTITUTE(O8," ",REPT(" ",99)),99*(LEN(O8)-LEN(SUBSTITUTE(O8," ",""))-2),LEN(O8)))

helpful

Assuming for now that the concentration levels are in column A: =( LEFT( A1, FIND ( "mg", A1) -1)) +0

Post Photo
like

Also can try flash fill

If a set of 4 characters

Say these are in col A
1234!?#€
756!?#€

=LEFT(a2,Len(a2)-4)

If the set of characters are the same this will return the numbers before it, based on the length of characters in the cell

Text to columns, use a delimiter of what you want to pull from

Related Posts

Experienced Hires, how do you feel about the recent $1500 “thank you” from Deloitte?

like

Is that possible to select different regime while filing ITR?

Example: For FY Apr 2021- Mar 22, I selected new regime in the company portal and hence more tax deducted. I have submitted the rent receipts to the company for tax exemption. Hence during filing ITR, can I select old regime and get tax return?

like

Hey Portland!!!
Wondering cost of living in and around portland?
I’m thinking about moving from SF to Portland for a great job salary starting around 90k. I’m 30 years old with 1 child who lives with his mother.

like

This is awesome. Thank you to whoever started this. Yes let's keep helping each other.

like

Hi guys!

I need help with something: I recently started using xlookup in excel to automate recurring tasks (accounting) but I have found that my peers and supervisors have difficulties understanding how the numbers are pulled, which makes their understanding of the files difficult.

What would be the best way to convert the result of an xlookup cell to a reference to the found cell?

Is there any way that could be applied to all the xlookups in an excel file?

Thanks in advance!!

like

I'm currently looking for a junior project management position, Can anyone give me some recommendations? Preferably remote or in Jacksonville, FL

like

Has anyone tried the prose shampoo company? I see ads about it all the time and they seem to have great reviews. I just want to be able to wear my hair natural 😩

like

Currently I work for a mid-sized InsureTech that’s had 2 rounds of layoffs in the past 6 months. Salary is 100k, with no defined bonus. I have close to 4 years of PO experience. I am debating whether I want to leave since my boss is very chill and I have amazing WLB. Benefits are eh. 15 PTO days and healthcare premiums are okay. Should I jump ship? What could I be making at a bigger company? What types of companies are most stable right now?

like

Anyone ever had a pending asylum case and got an employer to sponsor them? TIA!

like

Currently filling DS 160. My parents are currently in US on B2 and will go back in July. When I go for my H1 stamping, they will not be in US. Should I answer the question on whether they are in US based on where they will be when I go for stamping or where they are when I am filling the DS 160?

like

What shall I choose and why?

IBM 22.5 LPA Fixed + 0-10 % Variable
PWC SDC 23 LAP Fixed + 0-17% Variable
Oracle Consulting 25 LPA Fixed + 0-10% Variable

Role is almost same in all three.

Which has better OnSite opportunities outside india?

like

Is is okay to have dates mentioned in offer letter for PwC like below -

Date: {{Dte_es_:signer1:date}}

like

How is PwC SDC kol if we compare it with EY GDS and D USI?
In terms of project and Hike %?

likefunny

How often does your HR communicate to you regarding the interns in your team and what do they usually talk about?

Anyone go to One Medical Midtown? Or the other locations? Thinking of making a switch.

like

ZS leave karne ke baad FnF amount 2 parts me aata hai kya?

like

I completed PGDM (Finance) and am currently working as a Oracle Functional Analyst (Consulting) at Deloitte USI with 1.25 YoE. My area of Interest is Corporate Finance, Equity research, Valuations, Mergers & Acquisition, Investment Banking.
During Internship worked on Feasibility of start-ups and real estate property, Analysis of Mutual Funds, DCF Valuation, Altman Z Score, etc.
I am looking for a job change in the above mentioned areas and would appreciate any kind of help with it. Thanks 😊

like
like

Remember Dory’s mantra in Finding Nemo? Just keep swimming! And, as stated below, don’t just go through it, GROW through it! 😁❤️

Post Photo
likeuplifting

Additional Posts in Excel Genius

I have a simple formula outlining the condition that if the range of values for each row is greater than a particular cell within the same row, then highlight. Need to find a shortcut to replicate

like

Hi guys!

I need help with something: I recently started using xlookup in excel to automate recurring tasks (accounting) but I have found that my peers and supervisors have difficulties understanding how the numbers are pulled, which makes their understanding of the files difficult.

What would be the best way to convert the result of an xlookup cell to a reference to the found cell?

Is there any way that could be applied to all the xlookups in an excel file?

Thanks in advance!!

like

Is there a way to easily create all the permutations of 315 possible combinations of numbers in excel?

like

I have a date I need to match to an array of strings (that represents dates). Eg matching 6 nov 20 to (20201106, 20201107, etc. ). I can convert my date into this format using text(date,”yyyymmdd”) but then my lookup tried to match “20201106” with that list and the “ causes a mismatch. Any hints, and I would prefer not to change the array format?

like

Anybody know if you can access an older version of an excel file (like from version history) using vba?

Trying to write a script to compare old versions and list changes since a given date

like

I have a big data set, which is compiled via power query. The source data gets updates every now and then. As the client isn't consistent with his organizing, I get a problem with my pivot. (Cont)

likehelpful

Out of curiosity, what percent of your work/analyses are Excel based? And what other softwares do you use the most (Tableau, PowerBI, Alteryx, etc.)

My work has been 90% Excel based 10% Access/SQL based and friends at other firms seem to be using way more advanced programs.

like

Anyone use power query before? My goal is I have multiple look up values in one cell (separated by comma) and I need it to look up those values and return values from another table which also may have multiple values (separated by comma) anyone know how to do that? I played around with power query today but it wasn’t giving me what I wanted

like

Formula to convert the date on the left to the date on the right? I’ve been using text to columns then concatenation but I feel there must be a better way...thoughts? Thanks!

Post Photo
likehelpful

Too many format error, already tried the XLStylesTool. What next?

I have a spreadsheet that pulls data from rest APIs into power query. Is there anyway to make this sheet work for people on Mac?

likefunny

why is index match superior to vlookup?

likefunny

This isn’t exactly an excel question, but is there a way to clear the “last modified by” history on an excel document in SharePoint? Accidentally opened a file i shouldn’t have.

likefunny

Anyone have a easy formula to turn “2 years 6 months” into 2.5? Thanks!

Anyone know the shortcut to format selected cells as short date IE mm/dd/yyyy?

likesmart

Hello Excel Genius!
How do I calculate the monthly average of items returned and credit return by each division in a year?
Thank you!

like

Is there a way to color a cell based on the color of another cell? I have Sheet one with green, yellow, red used to denote progression status on 20 tasks, which constantly changes based on client input. Sheet 2 is a summary dashboard of each of those 20 tasks. If sheet1 C3 is green, how can I get the respective sheet 2 dashboard cell to also turn green?

like

Had an interesting issue this past week. Batch of client data looked normal in Excel, but when imported into our analysis software that we use for larger data sets and their manipulation (cont.)

Best way to learn Spotfire? Just watch YouTube videos?

Anyone have recommendations for a 5 year forecast model and/or template for a private company? (For a small fintech company)

like

New to Fishbowl?

Download the Fishbowl app to
unlock all discussions on Fishbowl.
That was just a preview…
Sign Up to see all discussions
  • Discover what it’s like to work at companies from real professionals
  • Get candid advice from people in your field in a safe space
  • Chat and network with other professionals in your field
Sign up in seconds to unlock all discussions on Fishbowl.

Already a user?
Login here

Share

Embed this post

Copy and paste embed code on your site

Preview

Download the
Fishbowl app

See what’s happening in your industry
from the palm of your hand.

A phone with Fishbowl app

Scan your QR code to download
Fishbowl app on your mobile

Download app

Sign up for free to view this conversation on Fishbowl

By continuing you agree to Terms of Use and Privacy Policy

Already have an account? Log in

Sign up for free to continue using Fishbowl

By continuing you agree to Terms of Use(New) and Privacy Policy(New)
Messaging rates may apply

Already have an account? Log in

For account settings, visit Fishbowl on Desktop Browser or

General

Legal