+ Reply to Thread
Results 1 to 9 of 9

IF formula

  1. #1
    Registered User
    Join Date
    02-07-2011
    Location
    ripley, tn
    MS-Off Ver
    Excel 2007
    Posts
    5

    IF formula

    I am trying to set up an excel table to automatically pick up pipe lengths according to the size of pipe baed on just text. Here is what I it looks like:
    REQ'D STORM DRAIN PIPE 15" X 82' RT.
    and the formula:
    =IF(ISNUMBER(FIND("15""",C8)),MID(C8,3… "")

    My formula is currently reading 3 characters for the pipe lengths. This is fine for lengths >100', but my problem is when they are <100' I am getting values with the ' symbol, I do not want that to show up. Is there a way to put in some and/or statement where based on the pipe length it picks up it decides on the number of characters to read? Or is there any other way to make the ' symbol just not show up?

    any help is appreciated

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF formula

    Based on the information you've supplied, I'd wrap a substitute around your MID formula
    =SUBSTITUTE(MID(C8,3,...)&"'","'","") with the ' symbol wrapped in quotes
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    02-07-2011
    Location
    ripley, tn
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: IF formula

    Sorry didn't realize I didn't paste the entire formula. Here is what I am working with:

    =IF(ISNUMBER(FIND("15""",C8)),MID(C8,30,3), "")

    so are you saying put the substitute in my IF statement before MID?

    thanks

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF formula

    =if(isnumber(find("15""",c8)),substitute(mid(c8,30,3)&"'","'",""), "")

  5. #5
    Registered User
    Join Date
    02-07-2011
    Location
    ripley, tn
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: IF formula

    Exactly what I needed. thanks alot

  6. #6
    Registered User
    Join Date
    02-07-2011
    Location
    ripley, tn
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: IF formula

    One more thing please. I use that formula and get a column of values, but it will not give me anything when I try to use SUM...any ideas?

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF formula

    =if(isnumber(find("15""",c8)),substitute(mid(c8,30,3)&"'","'","")+0, "")
    When using the LEFT, MID, RIGHT and Concatinate (&) functions, Excel sees the result as a text string. The +0 converts it back to a number

  8. #8
    Registered User
    Join Date
    02-07-2011
    Location
    ripley, tn
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: IF formula

    ok thats awesome. Last question I have.

    I have this IF statement here:
    =IF(D8="CB-01","1", "")

    How do I convert this formula back to a number so I can sum up these columns?

  9. #9
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: IF formula

    Quote Originally Posted by wglenn1 View Post
    ok thats awesome. Last question I have.

    I have this IF statement here:
    =IF(D8="CB-01","1", "")

    How do I convert this formula back to a number so I can sum up these columns?
    Remove the quotes from 1, if the if evaluates to 1 then it'll need to show a 1, if you enclose that in "1" your actually turning the 1 into text and not a number
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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