+ Reply to Thread
Results 1 to 6 of 6

SUM column B but if B contains blanks, sum it with column A for these rows?

  1. #1
    Registered User
    Join Date
    08-05-2012
    Location
    England
    MS-Off Ver
    MS Office 365 Business
    Posts
    11

    SUM column B but if B contains blanks, sum it with column A for these rows?

    Good afternoon everyone,

    I've ready through several other posts from other users requesting help with SUM, SUMIF, and IF/AND/OR formulas but I can't see anything which quite fits with my query here.

    I have a spreadsheet which is forecasting tonnage into our site for the week. I enter the estimated tonnage by weight p/day (lets call this column A) on a Friday for the following week. As we progress through the week, I enter the actual tonnage received for the previous day (column B).

    I am trying to determine a formula that will calculate the expected tonnage for the week, but leaning predominantly towards the actual tonnage.

    So basically, at the start of the week on a Monday, the calculation would simply show the estimated tonnage total (column A). As I fill in column B through the week, I need the formula to update to use this figure, as opposed to it's estimated figure in column A.

    I hope you are all still following at this point. I've tried various permutations on the formula but I just don't know if this is even possible and I'm asking too much? I thought I'd found the answer on an Excel support page which showed:

    =SUMIF(B13:31,"<>",A13:A31)

    but this returned a value which didn't seem to correlate with anything?

    Can any of you excel whizz's on here possibly help me?

    Many thanks!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,009

    Re: SUM column B but if B contains blanks, sum it with column A for these rows?

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: SUM column B but if B contains blanks, sum it with column A for these rows?

    Assuming you are only calculating for Monday - Friday, and Monday Forecast starts in cell A2, and Monday Actual starts in cell B2 then use this formula,
    This also assumes fridays Forecasting and Actuals data is in cell A6 and B6 respectively.. [Change cell references if necessary]

    =SUM(IF(B2="",A2,B2),IF(B3="",A3,B3),IF(B4="",A4,B4),IF(B5="",A5,B5),IF(B6="",A6,B6))

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: SUM column B but if B contains blanks, sum it with column A for these rows?

    SUM(if(B13:b31="",a13:a31,B13:B31)) with shift ctrl enter, its an array

    or
    =SUMIF(B13:B31,"",A13:A31)+SUM(B13:B31)

  5. #5
    Registered User
    Join Date
    08-05-2012
    Location
    England
    MS-Off Ver
    MS Office 365 Business
    Posts
    11

    Re: SUM column B but if B contains blanks, sum it with column A for these rows?

    Hi dosydos and davsth! Both of your solutions work perfectly, thank you so much! I was honestly demented yesterday trying to figure this out on my own. I just didn't think it was going to be possible.

    Thanks again!
    Last edited by Posthuman; 12-14-2018 at 04:09 AM. Reason: typo

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,009

    Re: SUM column B but if B contains blanks, sum it with column A for these rows?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Select entire Column of data even when there are blanks in some rows, xlDown
    By lougs7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2018, 02:08 PM
  2. [SOLVED] Mulitple rows to a single column leave blanks out
    By RJK in forum Excel General
    Replies: 4
    Last Post: 12-03-2016, 12:23 AM
  3. Replies: 8
    Last Post: 05-24-2013, 05:37 PM
  4. Scan a Column A (numbers and blanks) and copy its contents WITHOUT BLANKS into Column B
    By bighandsam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 05:16 PM
  5. delete rows containing blanks in column A
    By krish T in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2010, 03:35 AM
  6. Count the total number of rows in a column, with blanks included
    By jblumGRT in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2009, 06:55 PM
  7. Delete Rows when Blanks are found in Column A:A
    By ddiicc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-04-2005, 06:05 AM

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