+ Reply to Thread
Results 1 to 7 of 7

Formula for only adding cells when both cells contain data

Hybrid View

  1. #1
    Registered User
    Join Date
    02-21-2023
    Location
    Lydney
    MS-Off Ver
    2016
    Posts
    16

    Formula for only adding cells when both cells contain data

    Hi,

    I am struggling to find the right solution to my problem.

    I am pulling data from another sheet, to get prices for lots.
    Lot 1, lot 2 and a total (lot 1 + Lot 2) for Lot 3.

    However, if they only complete Lot 1 Costs-Lot 3 needs to remain Blank, the same with Lot 2 (Lot 3 remains Blank). However if they complete both Lot 1 & 2, then lot 3 needs to show the total cost for both (Lot 1+Lot2)

    Any wise help would be really appreciated.

    MMB0342
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,290

    Re: Formula for only adding cells when both cells contain data

    Try:
    Formula: copy to clipboard
    =IF(OR(C3=0,D3=0),"",SUM(C3:D3))
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-21-2023
    Location
    Lydney
    MS-Off Ver
    2016
    Posts
    16

    Re: Formula for only adding cells when both cells contain data

    unfortunately i cant seem to get this to work. but thanks

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,290

    Re: Formula for only adding cells when both cells contain data

    Please see the updated example.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-21-2023
    Location
    Lydney
    MS-Off Ver
    2016
    Posts
    16

    Re: Formula for only adding cells when both cells contain data

    I think I'm not being very clear in what I am after here.

    There is only 3 LOTs and only one line for the data. On the sheet I have shown 3 lines so you can see what I need, but it only needs to be on one line.
    So in lot one there may or may not be a figure, likewise with Lot 2. if this is the case then Lot 3 should always show a zero.
    If there is a figure in both Lot 1 & lot 2 then the sum of both needs to show in Lot 3 Cell.
    I have attached a new Spreadsheet that hopefully explains a little better, with two tabs.
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,290

    Re: Formula for only adding cells when both cells contain data

    And your problem is ... ?

    See the updated sample file.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-21-2023
    Location
    Lydney
    MS-Off Ver
    2016
    Posts
    16

    Re: Formula for only adding cells when both cells contain data

    Fantastic result, really appreciate you time and help thank you.

+ 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. Adding a formula with relative cell address to data cells quickly
    By Munchkin24 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2020, 04:45 AM
  2. Replies: 11
    Last Post: 04-04-2017, 03:49 PM
  3. Replies: 13
    Last Post: 07-16-2016, 10:53 PM
  4. [SOLVED] Formula to return N for cells with 0 and empty cells, and Y for cells with data
    By stpeter in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-13-2016, 05:20 PM
  5. [SOLVED] Adding specific text to cells based on another cells data criteria
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-26-2015, 02:08 PM
  6. formula for adding two cells
    By stoven in forum Excel General
    Replies: 2
    Last Post: 10-26-2009, 04:26 PM
  7. [SOLVED] Sum func. is adding cells not in specified range-when ever I type data in to cells
    By Big Daddy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-14-2005, 04:05 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