Remove characters in formula

d7ono

New Member
Joined
May 13, 2015
Messages
1
I need to run this formula but need it to ignore the text that is in cell W12.

Formula is =sum(w12*t12)/100

Cell w12 reads as ‘15 kestrel’

So I want to ignore everything but the 15, I have other cells with different text so it has to ignore generic text.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,012
Office Version
365
Platform
Windows
Hi & welcome to MrExcel.
If the number is always at the start & has a space after it, try
=(LEFT(W12,FIND(" ",W12)-1)*T12)/100
 
Last edited:

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,205
Office Version
365
Platform
Windows
It isn't important, but the "-1" is not required in Fluff's formula.

Also, if it is possible that sometimes the cell has no text at all after the number you could add this to avoid getting an error.
=(LEFT(W12,FIND(" ",W12&" "))*T12)/100
 

Forum statistics

Threads
1,081,615
Messages
5,360,037
Members
400,565
Latest member
Tommy O

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top