+ Reply to Thread
Results 1 to 25 of 25

Formula for sum of data that doesn't include blank spaces

  1. #1
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Angry Formula for sum of data that doesn't include blank spaces

    I am trying to sum up a row of numbers but do not want to include the blank cells in the total.
    if 'C5' cell is left blank I do not want to calculate in cell H5 but do wish to calculate the rest of the row in 'I5'.
    if 'E5' cell is left blank I do not want to calculate in cell 'I5' but do wish to calculate the rest of the row in 'H5'.
    I have tried but am lacking the know-how. please help

    attached file for reference
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula for sum of data that doesn't include blank spaces

    If the cells are blank, they wont be included in the total anyway?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula for sum of data that doesn't include blank spaces

    Maybe try at
    H3
    =(B3*C3+D3*E3+F3*G3)*(C3>0)

    I3
    =(B3*C3+D3*E3+F3*G3)*(E3>0)

  4. #4
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    thank you for stating that
    Last edited by Por2gal; 07-30-2019 at 05:31 AM.

  5. #5
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    Quote Originally Posted by Bo_Ry View Post
    Maybe try at
    H3
    =(B3*C3+D3*E3+F3*G3)*(C3>0)

    I3
    =(B3*C3+D3*E3+F3*G3)*(E3>0)
    how can i get an answer highlighted in the appropriate cell whilst leaving the neighbouring cell empty. i have attached an updated coloured coded workbook. thank you
    [I5 =SUM(D5*E5)+(F5*G5)] but H5 creates an answer that i want to see left blank due to C5 being blank, i already have the correct answer in I5.
    [H4=SUM(D4*E4)+(F4*G4)] but I4 creates an answer that i want left blank due to E4 being blank. i already have the correct answer in H4. whilst keeping the data complete on the table. Thank You
    Attached Files Attached Files

  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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    Can you please tell us if the results you have shown are the results you want? If not, what should they be (calculated manually)?

    What is the difference between the sum you want in I and that in H? I am not following your logic (which is not clear to me in the attachment - sorry).
    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.

  7. #7
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    im not sure of the correct terminology used in excel. but i think i have explained to the best of my understanding of my request for the answer of the coloured text in the cells:- new attachment supplied above.
    [I5 =SUM(D5*E5)+(F5*G5)] but H5 creates an answer that i want to see left blank due to C5 being blank, i already have the correct answer in I5.
    [H4=SUM(D4*E4)+(F4*G4)] but I4 creates an answer that i want left blank due to E4 being blank. i already have the correct answer in H4. whilst keeping the data complete on the table.
    Please excuse my limited vocabulary for excel
    Last edited by Por2gal; 07-30-2019 at 05:39 AM.

  8. #8
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    Can you please tell me what results you WANT to see in these cells (numbers, not explanations):

    Excel 2016 (Windows) 32 bit
    H
    I
    2
    Total Empty
    Total FULL
    3
    $ - $ -
    4
    $ 345.68
    $378.64
    5
    FALSE
    $378.64
    Sheet: Sheet1

  9. #9
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    Is this what you mean?

    In H3 copied down:

    =IF(C3="","",SUM(D3*E3)+(F3*G3))

    In I3 copied down:

    =IF(E3="","",SUM(D3*E3)+(F3*G3))

  10. #10
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    hi there, i wanted to sum up B4xC4 and F4xG4 into H4... but I wanted to leave I4 blank because E4 has no data in the cell. the same for I5 in red to relate to the sums in red from D5xE5 and F5xG5, in this H5 should be left blank as I want it to relate only to B5xC5 and F5xG5. if C5 is left blank then i would like H5 to be left blank . the 'false' came up when i tried to remedy this myself.. to no avail

  11. #11
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    So did the formulae I gave you work for you?

  12. #12
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    unfortunately i have an error, as attached
    Attached Images Attached Images

  13. #13
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    Are you running a machine with a European locale? Try changing the commas to semi-colons:

    =IF(C3="";"";SUM(D3*E3)+(F3*G3))
    Attached Files Attached Files
    Last edited by AliGW; 07-30-2019 at 06:24 AM.

  14. #14
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    thank you so much, that is exactly how i wanted to view my answer,
    Attached Images Attached Images

  15. #15
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    You're welcome - and thanks for the little animated thank you.

  16. #16
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    sorry to bother you, if i add data to cell E4, i get the answer in H4 but sums up the exact same answer in I4. how do i collect the sum of B4xC4 and F4xG4 for the answer in H4 plus the sum of D4xE4 and F4xG4 for the answer in I4 so that the answer differs from H4. or should i create a new thread for this question? please and thanks

  17. #17
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    Can you upload a sample workbook showing the issue? Again, please fill in the answers that you expect manually.

  18. #18
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    so i have added my request onto the file you sent me. as Atttached. in keeping the format you calculated for me I wanted the option to sum up the total of the row without doubling up on F & G
    Attached Files Attached Files

  19. #19
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    I'm struggling with your logic here. What on Earth does this mean?

    Excel 2016 (Windows) 32 bit
    C
    D
    E
    F
    G
    H
    I
    10
    answer answer
    11
    121.68
    224.00
    345.68
    or
    121.68
    or
    345.68
    12
    154.64
    378.64
    378.65
    154.64
    Sheet: Sheet1

    Why have you shown results in one row?

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    7
    32
    2.40
    50.70
    3.05
    50.70
    28.00
    8.00
    345.68
    378.64
    Sheet: Sheet1

    And finally, how should Excel determine when it should calculate FxG?

  20. #20
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    Quote Originally Posted by AliGW View Post
    I'm struggling with your logic here. What on Earth does this mean?

    Excel 2016 (Windows) 32 bit
    C
    D
    E
    F
    G
    H
    I
    10
    answer answer
    11
    121.68
    224.00
    345.68
    or
    121.68
    or
    345.68
    12
    154.64
    378.64
    378.65
    154.64
    Sheet: Sheet1

    Why have you shown results in one row?

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    7
    32
    2.40
    50.70
    3.05
    50.70
    28.00
    8.00
    345.68
    378.64
    Sheet: Sheet1

    And finally, how should Excel determine when it should calculate FxG?
    the first picture shows the summing up of cells. but how do i format this in the formular bar
    the summing up of row 7 in H and I, but i would like to exclude FxG if its already been used in conjunction with DxE or BxC. this being that if [DxE+FxG+BxC= total]or [BxC+FxG+DxE=total]. thank you for considering my awkward question
    Last edited by Por2gal; 08-01-2019 at 01:27 AM.

  21. #21
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    OK, so how do we know which side the FxG calculation should be included?

  22. #22
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    [ arrr that is the million dollar question ] if an answer is already summed up in cell 'H' then cell 'I' should only calculate DxE, should it be an 'SUMIF' function or a 'LoOKUP' or an 'ERROR', based on whether DxE has or has not been used. and if i choose to calculate BxC later on the same row: should I use the 'IF' function. I was hoping there would be a conditional formular or function to use based on whether these cells are being used in conjunction with each other or not. i could just manually delete the required calculation in the formular bar each time.?

  23. #23
    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
    80,830

    Re: Formula for sum of data that doesn't include blank spaces

    This is what I feared. I really don't think this can be done: you have to be able to 'teach' Excel the logic within the formula, and if there is no logic, then you can't build a formula. I think you might be able to do it with VBA, but again, there would need to be some logic.

    I'm afraid I have reached the end of the road here. Sorry!

  24. #24
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula for sum of data that doesn't include blank spaces

    Maybe try at
    H7
    =IF(C7>E7,F7*G7,)+B7*C7

    I7
    =IF(C7>E7,,F7*G7)+D7*E7

  25. #25
    Registered User
    Join Date
    01-10-2019
    Location
    Auckland, New Zealand
    MS-Off Ver
    2013 home
    Posts
    79

    Re: Formula for sum of data that doesn't include blank spaces

    cheers for that; thank you again for all your help, I really appreciate you considering my dilemma.
    Attached Images Attached Images

+ 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. Formula for percentage of word data that doesn't include blank spaces
    By BrigitteWatts in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 07-29-2019, 12:42 PM
  2. [SOLVED] List data that doesn't match, results displayed without spaces between them.
    By billrogers184 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-16-2018, 09:56 AM
  3. [SOLVED] Filter for a list that doesn't read blank spaces
    By Manena in forum Excel General
    Replies: 3
    Last Post: 09-14-2015, 02:13 PM
  4. formula that doesn't include 0 values
    By amartino44 in forum Excel General
    Replies: 1
    Last Post: 12-06-2013, 03:09 PM
  5. Formula to include spaces in linked data validation list
    By hbomb1927 in forum Excel General
    Replies: 2
    Last Post: 10-25-2011, 07:01 PM
  6. Use a function in a chart range so it doesn't include a cell if blank?
    By hokeyplyr48 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-03-2008, 12:32 PM
  7. Replies: 0
    Last Post: 02-25-2005, 08:08 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