+ Reply to Thread
Results 1 to 4 of 4

subtract two collums only if value

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    20

    subtract two collums only if value

    Hello

    I am looking for a way to subtract to collums.

    In the first A there is always a value.

    In the second B a value needs to be added.

    When the second value is added I want collum B to substract from A.

    Then I want the result of all to be given in a cell, not just B1-B2 but (B1:B50)-(A1:A50).

    The thing is that if collum B is empty, I don't want that line to be counted.

    Maybe it is a bit complicated.

    I started with:

    Please Login or Register  to view this content.
    But I have 600 Lines

    Can anyone help me

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: subtract two collums only if value

    Try this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-14-2019
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: subtract two collums only if value

    You'll need to be careful with how you manage column B. If column B is empty.... has null values (blank), then the "<>0" will not return the correct answer. You will need to use something like this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-14-2019
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: subtract two collums only if value

    You can actually shorten this a bit to:

    Please Login or Register  to view this content.
    "<>" indicates that it is to sum all records that are not empty.

+ 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. Compare within columns and other collums
    By kjkjetil in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-04-2018, 09:16 AM
  2. [SOLVED] Compare two collums with nine numbers.
    By blake20 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-26-2017, 02:24 AM
  3. Compare 3 Collums and delete duplicate
    By nackgr in forum Excel General
    Replies: 12
    Last Post: 01-04-2011, 08:27 AM
  4. Date formatting for collums
    By Bigyaw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2008, 03:02 PM
  5. Sum of current row from selected collums
    By FabianN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2008, 02:54 AM
  6. Compare/Sum different Collums
    By Jimbras in forum Excel General
    Replies: 2
    Last Post: 09-12-2007, 12:11 PM
  7. [SOLVED] matches in two collums of numbers?
    By kdbeal in forum Excel General
    Replies: 1
    Last Post: 11-07-2005, 11:25 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