Results 1 to 7 of 7

Thread: sumif on non contiguous cells
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Mar 2018
    Posts
    267
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default sumif on non contiguous cells

    I have named cells A1,B2,C3,D4 as "lfk"
    these cells have some values
    when I used =SumIf(A1:D4,lfk)
    - I didn't get anything, what is wrong with the formula?
    many many thanks

  2. #2
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,192
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    2 Thread(s)

    Default Re: sumif on non contiguous cells

    array (Ctrl+Shift+Enter)
    =SUM(A1:D4*(ROW(A1:D4)=COLUMN(A1:D4)))

    or non array (just Enter)
    =SUMPRODUCT(N(OFFSET(A1,ROW(INDIRECT("1:4"))-1,ROW(INDIRECT("1:4"))-1)))

  3. #3
    Board Regular
    Join Date
    Mar 2018
    Posts
    267
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: sumif on non contiguous cells

    Mr. Urtis
    thank you for your prompt reply.
    your formula worked.
    my question is - how can I use the cell name into the formula?
    is it possible?
    many thanks
    Last edited by LFKim2018; Sep 12th, 2018 at 09:48 PM.

  4. #4
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,192
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    2 Thread(s)

    Default Re: sumif on non contiguous cells

    I must not be understanding what the problem is.
    Just now I named a range lfk which I defined in the Name Manager as =Sheet1!$A$1,Sheet1!$B$2,Sheet1!$C$3,Sheet1!$D$4
    Then I entered the formula
    =SUM(lfk)
    which returned the same result as both the formulas I posted, which was what I expected.
    What am I missing about what you are expecting?

  5. #5
    Board Regular
    Join Date
    Mar 2018
    Posts
    267
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: sumif on non contiguous cells

    Mr. Urtis

    I just received your message:

    Just now I named a range lfk which I defined in the Name Manager as =Sheet1!$A$1,Sheet1!$B$2,Sheet1!$C$3,Sheet1!$D$4
    Then I entered the formula
    =SUM(lfk)

    This is the formula I am looking for.
    many many thanks


  6. #6
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,192
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    2 Thread(s)

    Default Re: sumif on non contiguous cells

    Thanks.
    I neglected to mention but you probably know, if the sheet of interest is not named Sheet1 then modify the sheet name accordingly in the Name Manager for the defined name.

  7. #7
    Board Regular
    Join Date
    Mar 2018
    Posts
    267
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: sumif on non contiguous cells

    thank you..

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •