+ Reply to Thread
Results 1 to 5 of 5

Error in if statement with arguments

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Error in if statement with arguments

    i want to see if Length of cell is 6 then take the mid value from space 9 on cell f187 otherwise take the value from space 11

    i am trying to use this formula but it is giving error, if someone help



    =IF(LEN(+A187=6,MID(F187,9,35),LEN(f187,11,35))) assume A187 = 123456

    Thanks for help
    Last edited by rajubhayana; 07-15-2020 at 01:38 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Help needed in This formula

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Error in if statement with arguments

    I am assuming that your last LEN was supposed to be another MID? Also, you neglected to close the ) in your LEN function.
    =IF(LEN(+A187=6,MID(F187,9,35),LEN(f187,11,35)))
    =IF(LEN(A187)=6,MID(F187,9,35),MID(F187,11,35))

    This can be simplified to...
    =MID(F187,IF(LEN(A187)=6,9,11),35)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    06-12-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Error in if statement with arguments

    Thanks alot

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Error in if statement with arguments

    Happy to help

+ 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] Improved Formula / i've run out room to extend the current formula / (avdanced code needed
    By pmw19800 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2018, 06:19 AM
  2. date formula help needed with blank cell and monthly assumtions formula needed
    By Michael.Howarth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2018, 07:47 AM
  3. Replies: 3
    Last Post: 04-06-2016, 12:19 PM
  4. Replies: 1
    Last Post: 01-11-2016, 02:31 PM
  5. Replies: 7
    Last Post: 02-03-2013, 06:25 PM
  6. [SOLVED] index formula needed--how to get a formula to skip columns
    By rsmidtisu in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-02-2012, 11:22 AM
  7. Replies: 3
    Last Post: 09-07-2012, 12:07 AM

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