+ Reply to Thread
Results 1 to 6 of 6

Removing text from numbers & using result in formula

  1. #1
    Registered User
    Join Date
    11-01-2019
    Location
    CT
    MS-Off Ver
    Office 365
    Posts
    3

    Removing text from numbers & using result in formula

    Hello - I have raw data that gives me numbers of years (0yrs., 1yrs., 2yrs., ... 17yrs., 18yrs., etc). I want to use just the number of years in another formula that will provide a 'yes/true' value if the record has more than 4 years (among many other conditions). I was able to isolate the number by using =SUBSTITUE(H2,"yrs.",""). But now that isolated number isn't working in my next formula... OR(...,...,BF5>=4). The rest of the formula/ conditions work. I assume this is some text/number issue, but I'm not sure of the solution. If there is a better way to isolate the number from "yrs." I'm open to that as well.

    Thank you.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Removing text from numbers & using result in formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    11-01-2019
    Location
    CT
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Removing text from numbers & using result in formula

    Thank you KOKOSEK, that seemed to work for a majority of my question. But of course, a new problem has arose in the output of my second formula (not the substitute), the ...OR( ... , BF5>=4) formula. The issue is when there is no data for what the OR( is referencing. When there is a year from the substitute for the unique ID, your solution works. But if there is no data, the OR( formula is still resulting in a YES/TRUE. I currently have a IFERROR( formula to display a "0" if there is no data.

    Please let me know if you need more information.

  4. #4
    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,206

    Re: Removing text from numbers & using result in formula

    The actual OR statement will help PLUS a sample workbook (see yellow banner at top of page on instructions on attaching a workbook)
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    11-01-2019
    Location
    CT
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Removing text from numbers & using result in formula

    Hi JohnTopley - Unfortunately the file size is to large to upload (38k+KB), and the formula is so interconnected with other tabs I cannot just pull out the few sheets it needs to reduce the size. I will provide the full formulas below.

    This is the end formula. Where the undesired result is coming from is in bold. Essentially the final output for this entire formula is Yes or No, if there is an error, the answer is also No.
    =IFERROR(IF(AND(($I5*0.15)>((RF!$AE$32*0.04)/$F5),$D5<>"LP",OR($BG5={"A+","A","A-","B+","B","B-","NR"}),$BB5>=0.04,OR($BD5="Yes",BE5>=4,BF5>=4)),"Yes","No"),"No")

    For this particular question. We start in a different tab full of raw data and use the substitute formula to remove 'yrs.' from the number ( =SUBSTITUTE(H2,"yrs.","")+0 ). The result of this substitute formula is then Indexed matched into a new tab that contains the large formula above using the following formula:

    =IFERROR(INDEX(TAB2!$1:$1048576,MATCH($A5,Tab2!A:A,0),MATCH(BF$3,TAB2!$1:$1,0)),"0")

    If there is a matching record, and a number that has resulted from the substitute formula, it is than displayed in column BF5. If there is and error (no result/match), there is a 0 put in column BF. I believe the issue is coming from when there is no matching result and a 0 is displayed. for some reason it is tricking the formula at the top that the result should be YES/TRUE

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Removing text from numbers & using result in formula

    Hello RJB78. Welcome to the forum.

    MS-Off Ver unsure
    Please try clicking File >> Account
    You should see "Product Information" in the right hand column. Please update your profile. Contributors tailor solutions with those profile details in mind.
    Dave

+ 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] Removing text from numbers
    By EvansB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2021, 12:58 PM
  2. [SOLVED] Removing text quotes in formula result
    By Wizards in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-08-2014, 01:00 AM
  3. Removing numbers from a cell containing text and numbers
    By wraith75 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 09-13-2012, 06:23 AM
  4. [SOLVED] I need help with removing text and only showing numbers
    By Mina Lieung in forum Excel General
    Replies: 7
    Last Post: 05-23-2012, 02:46 AM
  5. Removing #N/A result in vlookup formula
    By dperry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2009, 07:51 PM
  6. Removing text from numbers
    By ucmexcel in forum Excel General
    Replies: 3
    Last Post: 12-30-2008, 12:39 PM
  7. Removing Text from numbers
    By kdeal in forum Excel General
    Replies: 2
    Last Post: 10-17-2006, 02:08 PM

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