+ Reply to Thread
Results 1 to 6 of 6

Formula too long

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    Arad, Romania
    MS-Off Ver
    Excel 2003
    Posts
    3

    Formula too long

    Could you please help me to reduce the formula:

    =(A2=sheet2!A3)*sheet2!I3+(A2=sheet2!A4)*sheet2!I4+(A2=sheet2!A5)*sheet2!I5+(A2=sheet2!A6)*sheet2!I6+(A2=sheet2!A7)*sheet2!I7+(A2=sheet2!A8)*sheet2!I8+(A2=sheet2!A9)*sheet2!I9+(A2=sheet2!A10)*sheet2!I10+(A2=sheet2!A11)*sheet2!I11+(A2=sheet2!A12)*sheet2!I12+(A2=sheet2!A13)*sheet2!I13+(A2=sheet2!A14)*sheet2!I14+(A2=sheet2!A15)*sheet2!I15+(A2=sheet2!A16)*sheet2!I16+ ......+(A2=sheet2!A60)*sheet2!I60

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: Formula too long

    Maybe this:

    =SUMPRODUCT(--(sheet2!A3:A60=A2);sheet2!I3:I60)
    Never use Merged Cells in Excel

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,720

    Re: Formula too long

    ...or SUMIF for a single criterion, i.e.

    =SUMIF(sheet2!A3:A60,A2,sheet2!I3:I60)
    Audere est facere

  4. #4
    Registered User
    Join Date
    12-08-2010
    Location
    Arad, Romania
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula too long

    Quote Originally Posted by zbor View Post
    Maybe this:

    =SUMPRODUCT(--(sheet2!A3:A60=A2);sheet2!I3:I60)
    Here is my problem:

    I have 2 sheets:

    sheet 1 where:
    in column A I want to choose from a drop-down list the products
    In column B I want to appear the price of the chosen product

    Sheet 2 contains on column A all the products and on column I the prices for each product.

    It works with IF formula :=IF(A1=sheet2!A3,sheet2!I3,IF(A1=sheet2!A4,sheet2!I4,IF ..............0)) but the formula is too long.

    It is obvious that I am novice.
    Thank you.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,720

    Re: Formula too long

    Did you try the suggestions above?

  6. #6
    Registered User
    Join Date
    12-08-2010
    Location
    Arad, Romania
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Formula too long

    Quote Originally Posted by daddylonglegs View Post
    ...or SUMIF for a single criterion, i.e.

    =SUMIF(sheet2!A3:A60,A2,sheet2!I3:I60)
    Thank you. That I was looking for. Problem solved!

+ 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