+ Reply to Thread
Results 1 to 8 of 8

How to Sum first 12 cells in a row once a cell has data.

  1. #1
    Registered User
    Join Date
    12-20-2023
    Location
    Franklin, TN
    MS-Off Ver
    Office 365
    Posts
    3

    How to Sum first 12 cells in a row once a cell has data.

    I need help writing a formula to return the sum of the first 12 cells in a row once the first cell has data and regardless if the next 11 have data or not. I'm trying to obtain the first 12 months of revenue for each customer. I've been able to write a formula that sums the first 12 cells with data, but I need one that sums the first 12 regardless if subsequent months have data. So even if there is only 11 months of revenue in the first 12 calendar months for a customer I need to include the month with zero revenue. Thank you all for your help, I've been banging my head against the wall on this one.
    Attached Files Attached Files
    Last edited by andrebr; 12-20-2023 at 03:50 PM. Reason: Attaching example

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2505
    Posts
    1,527

    Re: How to Sum first 12 cells in a row once a cell has data.

    Welcome to the forum.

    Please follow instructions on yellow banner above to upload a sample wb.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,478

    Re: How to Sum first 12 cells in a row once a cell has data.

    Assuming the cells you are interested in are A1:L1 (change this in the formula to your actual range and change the A1 to the first cell of that actual range), try this formula...

    =IF(A1="","",SUM(A1:L1))
    Last edited by Rick Rothstein; 12-20-2023 at 03:43 PM.

  4. #4
    Registered User
    Join Date
    12-20-2023
    Location
    Franklin, TN
    MS-Off Ver
    Office 365
    Posts
    3

    Re: How to Sum first 12 cells in a row once a cell has data.

    Thank you for the guidance I've attached a sample workbook. I'm looking to have the sum of the first 12 months in column BQ for the 5 "customer's" listed.

  5. #5
    Registered User
    Join Date
    12-20-2023
    Location
    Franklin, TN
    MS-Off Ver
    Office 365
    Posts
    3

    Re: How to Sum first 12 cells in a row once a cell has data.

    Thank you Rick, the issue I'm running into is that I'm only trying to sum the first 12 rows of when data occurs. So in the sample workbook I would like to be able to sum the customers first 12 calendar months of revenue once it is greater than zero, but not sum anything after that for thousands of rows. Thank you again for the suggestion.

  6. #6
    Registered User
    Join Date
    12-17-2023
    Location
    Indianapolis, IN
    MS-Off Ver
    Office Professional Plus 2021
    Posts
    18

    Re: How to Sum first 12 cells in a row once a cell has data.

    Alternatively, in case A1 is a blank and not NULL do this, otherwise a blank in A1 will trigger the SUM.

    =if(ISNUMBER(A1),SUM(A1:L1),"")

  7. #7
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to Sum first 12 cells in a row once a cell has data.

    andrebr, your way to store data is not good, please think about storing it vertically as in the attached file and use Pivot Table to summarize it.

    Attachment 853201
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2505
    Posts
    1,527

    Re: How to Sum first 12 cells in a row once a cell has data.

    Please try this in a blank cell of your choosing and drag down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Good luck!

+ 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. Replies: 3
    Last Post: 05-15-2017, 03:24 PM
  2. Replies: 8
    Last Post: 04-28-2016, 11:58 AM
  3. Compare two cells, if equal move a third cells data to another cell
    By eriick in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2013, 05:38 PM
  4. Replies: 0
    Last Post: 09-22-2012, 02:20 AM
  5. Replies: 3
    Last Post: 09-20-2012, 04:26 PM
  6. Copying cells after last cell, with out overwriting data in cells above.
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2012, 02:23 PM
  7. Trying to format one cell to match data in two cells and input data from third cell
    By Ghostcoy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-29-2010, 12:10 PM

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