+ Reply to Thread
Results 1 to 8 of 8

cell minus another cell, unless value in 3rd celll

  1. #1
    Registered User
    Join Date
    06-05-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    23

    cell minus another cell, unless value in 3rd celll

    Hi Guys,

    Hoping someone can help me with this formula.

    In Cell S3 I would like the the sum of M3 - Q3, unless there is a value in P3, if there is a value in P3 then i would want the sum to be M3-P3 instead.

    Sometimes there will be a value in the P column and some times there wont, but there will always be a value in the M column

    If P3 was to be blank i need the sum to go back to the original M3 - Q3

    Thanks in advancesheet.png

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: cell minus another cell, unless value in 3rd celll

    =IF(P3="", SUM(M3:Q3),SUM(M3:P3))

    Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet.

    A sample sheet would help here, and possibly will enable a quicker and more accurate solution for you.


    The forum does allow for spreadsheets to be uploaded direct to the forum -

    Please see the Yellow Banner at the top of the page explaining how to attach a sample spreadsheet

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    Here are the instructions, found at the top of the page again
    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    06-05-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    23

    Re: cell minus another cell, unless value in 3rd celll

    Sorry i should of uploaded a sheet and explained it better.

    So, in the attached sheet:

    in Cell E3 I would like the sum B3-D3 as cell C3 is blank, however, if there was a value in Cell C3 i would want E3 to return C3- D3.

    So for example, the sum for E3 would need to be B3-D3 resulting in £32,591.62 but on the next line the return i need in E4 is C4-D4 because there is a value in C4 which should result in £15,993.15

    Hope thats a bit clearer
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: cell minus another cell, unless value in 3rd celll

    Try this in E3 and copy down.

    =IF(C3="",B3-D3,C3-D3)

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: cell minus another cell, unless value in 3rd celll

    the SUM() and then cell-cell was bit confusing
    anyway
    the formula still is valid - just different , as we are now sub tracking and not summing a range , and different cells
    principle is the same

    =IF(C3="",B3-D3,C3-D3)
    Attached Files Attached Files

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: cell minus another cell, unless value in 3rd celll

    Or try in E3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-05-2023
    Location
    England
    MS-Off Ver
    365
    Posts
    23

    Re: cell minus another cell, unless value in 3rd celll

    Thanks guys works perfectly

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: cell minus another cell, unless value in 3rd celll

    you are 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. Create a formular in a celll that can filter just number from a cell
    By Henry2010 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-21-2019, 06:43 AM
  2. find a specific part of a cell & copy to another celll
    By Lewis1012 in forum Excel General
    Replies: 15
    Last Post: 05-23-2014, 10:01 AM
  3. Without using a mouse, how can I drag the contents from cell to celll
    By m230000 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 05-30-2013, 11:38 PM
  4. [SOLVED] convert a single-celll range to a cell
    By jimredfield in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 06:43 PM
  5. [SOLVED] Change conditional format (color) of a cell based on another celll (Excel 2010)
    By ffnptown in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-28-2012, 09:50 PM
  6. [SOLVED] Control Formating from one cell to another celll in workbook
    By CTrujillo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 05:50 PM
  7. [SOLVED] Tab in a cell?:Is there any way to insert a tab in a celll
    By Ket in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-22-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