+ Reply to Thread
Results 1 to 5 of 5

SUMIF formula of precedeing cells

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    SUMIF formula of precedeing cells

    Hi all,

    Hope all is well. I would like to ask a simple formula for the following problem I have.

    Basically I have column A which consists of 1 and 0.

    I would like to add a formula in column B which would produce the sum of the 1's however only the cells which precede that particular cell. That is:



    A B

    1 1
    0
    0
    0
    0
    0
    0
    0
    1 2
    0
    0
    0
    0
    0
    0
    0
    1 3
    0
    0
    0
    1 4

    Can someone please guide me though ? Thanks a lot for your kind help

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: SUMIF formula of precedeing cells

    Hi,

    In B1, try,

    =IF($A1>0,SUM($A$1:$A1),"")

    and copy down

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: SUMIF formula of precedeing cells

    In B1

    =IF(A1<>1,"",SUMIF($A$1:A1,1,$A$1:A1))
    Cheers!
    Deep Dave

  4. #4
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: SUMIF formula of precedeing cells

    Thanks a lot guys! Both solutions worked !! Appreciate a lot

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: SUMIF formula of precedeing cells

    You're welcome

+ 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. SumIf formula or Sumif with pivottable combined question
    By mcgleeuw in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-10-2015, 01:05 PM
  2. Replies: 1
    Last Post: 07-08-2015, 02:53 AM
  3. How to sum up the cells which with "sumif" formula
    By tccheung in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-22-2014, 02:27 AM
  4. [SOLVED] Shorten SUMIF + SUMIF + SUMIF each with same reference range but different criteria???
    By HeyInKy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-13-2014, 09:25 PM
  5. SUMIF or SUMIF's formula with multiple criteria
    By jackiemariee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-30-2013, 06:19 PM
  6. Formula using sumif depending on date in two cells
    By enhydra in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-19-2012, 04:27 AM
  7. Replies: 4
    Last Post: 08-22-2012, 12:18 PM

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