+ Reply to Thread
Results 1 to 4 of 4

Sumif horizontally (same row)

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Sumif horizontally (same row)

    I need to sum a row, summing values that have a certain value in the preceding cell.

    For example:

    A B C D E F G H SUM

    x 7 y 8 x 4 z 4 11 based on a formula like =sumif((a1,c1,e1,g1),"x",(b1,d1,f1,h1))

    Or if there were a criteria such as =Sumif(a1:h1,"precedingcell=x",a1:h1)

    No luck yet finding a formula that will work.

    Thanks for the help.

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

    Re: Sumif horizontally (same row)

    Try

    =SUMPRODUCT(--(A1:G1="x"), B1:H1))
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Sumif horizontally (same row)

    Perfect! Thanks!!

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

    Re: Sumif horizontally (same row)

    There's no reason why you can't do that with SUMIF

    =SUMIF(A1:G1,"x",B1:H1)
    Audere est facere

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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