# Error in if statement with arguments

1. ## 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

2. ## Re: Help needed in This formula

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.)

3. ## 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)

Thanks alot

5. ## Re: Error in if statement with arguments

Happy to help

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

#### 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