+ Reply to Thread
Results 1 to 6 of 6

Formula too long

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    Essex, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Formula too long

    Hello,

    I am trying to have a word appear in a cell when a number in inserted in the cell to the left of it. I am using a list of another sheet to store the number and words. Eg (A1) 1 = (B1) Brentwood, (A2) 1 = (B2) Billericay. So when I type 1 into A1, Brentwood would automatically appear in B1.

    I have used the following formula for a small number, but my list is too big and means the formula is too big (Too many arguments). Here it is:

    =IF(f2=Sheet1!A$1, Sheet1!B$1,IF(f2= Sheet1!A$2, Sheet1!B$2,IF(f2= Sheet1!A$3, Sheet1!B$3,IF(f2= Sheet1!A$4, Sheet1!B$4,IF(f2= Sheet1!A$5, Sheet1!B$5) ,IF(f2= Sheet1!A$6, Sheet1!B$6,IF(f2= Sheet1!A$7, Sheet1!B$7,IF(f2= Sheet1!A$8, Sheet1!B$8,IF(f2= Sheet1!A$9, Sheet1!B$9,IF(f2= Sheet1!A$10, Sheet1!B$10,IF(f2= Sheet1!A$11, Sheet1!B$11,IF(f2= Sheet1!A$12, Sheet1!B$12,IF(f2= Sheet1!A$13, Sheet1!B$13,IF(f2= Sheet1!A$14, Sheet1!B$14,IF(f2= Sheet1!A$15, Sheet1!B$15,IF(f2= Sheet1!A$16, Sheet1!B$16,IF(f2= Sheet1!A$17, Sheet1!B$17,IF(f2= Sheet1!A$18, Sheet1!B$18, IF(f2= Sheet1!A$19, Sheet1!B$19,IF(f2= Sheet1!A$20, Sheet1!B$20,IF(f2= Sheet1!A$21, Sheet1!B$21,IF(f2= Sheet1!A$22, Sheet1!B$22,IF(f2= Sheet1!A$23, Sheet1!B$23,IF(f2= Sheet1!A$24, Sheet1!B$24,IF(f2= Sheet1!A$25, Sheet1!B$25,IF(f2= Sheet1!A$26, Sheet1!B$26,IF(f2= Sheet1!A$27, Sheet1!B$27,IF(f2= Sheet1!A$28, Sheet1!B$28,IF(f2= Sheet1!A$29, Sheet1!B$29,IF(f2= Sheet1!A$30, Sheet1!B$30,IF(f2= Sheet1!A$31, Sheet1!B$31)))))))))))))))))))))))))))))))

    I have added the $ symbol so I can drag the formula without the inputs changing.

    Many thanks,

    Luke

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Formula too long

    =vlookup(A1,Sheet1!$A:$B, 2, false)

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Formula too long

    You need to have unique numbers in column A - is that a typo when you say A2 = 1 and B2 = Billericay ?

    If so, then you can use VLOOKUP, like this:

    =VLOOKUP(F2,Sheet1!A:B,2,0)

    That's all you need to replace that monster formula.

    Hope this helps,

    Pete

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Formula too long

    Luke

    Try this

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    12-17-2013
    Location
    Essex, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Formula too long

    Thank you, it seems to have worked

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Formula too long

    You're welcome - 3 people suggested the same solution, so I think it's a fair bet that it would work.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, I would like to inform you that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Shortening of long array formula by short formula
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-29-2013, 05:51 AM
  2. [SOLVED] Formula is too long
    By shasse in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-28-2013, 03:55 PM
  3. Very Long If Formula for VBA
    By Floydlevedale in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-24-2013, 11:55 AM
  4. IF Formula too long
    By siyanako in forum Excel General
    Replies: 4
    Last Post: 06-26-2011, 09:08 PM
  5. Long long formula not calc'ing all steps
    By jvautour in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-01-2009, 10:26 AM

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