+ Reply to Thread
Results 1 to 9 of 9

Need help replacing #DIV/0! from a SUM, with the value from another field

  1. #1
    Registered User
    Join Date
    07-15-2013
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2003 & Excel 2010
    Posts
    5

    Need help replacing #DIV/0! from a SUM, with the value from another field

    In other words, when a sum returns the value #DIV/0!, I want to then have the value of another field placed in that cell.

    My formula
    =SUM(S17*C17)/K17

    I want to replace the calculated value #DIV/0! with the value in cell G17

    Where
    S17=2
    C17=11
    K17=0
    G17=7

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    Try

    =S17*C17/IF(K17=0,G17,K17)

  3. #3
    Registered User
    Join Date
    07-15-2013
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2003 & Excel 2010
    Posts
    5

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    Thanks - That does not return the error, but it fills the cell with the value '3' which is not the value in G17. ?

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    =IFERROR(SUM(S17*C17)/K17,G17)
    or
    =IF(ISERROR(SUM(S17*C17)/K17),G17,SUM(S17*C17)/K17)



    EDIT: the SUM function is redundant and can be done away with..
    hence,
    =IFERROR(S17*C17/K17,G17)
    or
    =IF(ISERROR(S17*C17/K17),G17,S17*C17/K17)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    OH, OK..

    I thought you wanted to devide the result of S17*C17 by K17 (or G17 if K17 is 0)...

    Try

    =IF(K17=0,G17,S17*C17/K17)

  6. #6
    Registered User
    Join Date
    07-15-2013
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2003 & Excel 2010
    Posts
    5

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    That did it! Thanks so much - have a great week!

  7. #7
    Registered User
    Join Date
    07-15-2013
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2003 & Excel 2010
    Posts
    5

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    Thanks for the heads up about the sum function. Excel novice here. Got the problem solved in record time with help from this forum though!

  8. #8
    Registered User
    Join Date
    07-15-2013
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2003 & Excel 2010
    Posts
    5

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    Problem solved. Thanks Jonmo1 and Ace_XL!

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need help replacing #DIV/0! from a SUM, with the value from another field

    You're 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. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  2. Replies: 9
    Last Post: 05-22-2012, 08:59 AM
  3. Replies: 3
    Last Post: 03-03-2012, 12:16 PM
  4. replacing 2 letters in a field
    By manny1975 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-21-2007, 02:15 PM
  5. Naming field & replacing characters
    By Mike R. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2005, 10:05 AM

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