+ Reply to Thread
Results 1 to 9 of 9

Excel formula calculation sometimes gives errors

Hybrid View

  1. #1
    Registered User
    Join Date
    12-28-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    4

    Angry Excel formula calculation sometimes gives errors

    I have a simple formula based excel (attached), Where columns :-
    O will have value of column B, if it is the last occurrence of the value.
    =IF(ISNA(VLOOKUP(B35,B36:D$5629,1,0)),B35,"")
    P will have sum of column N, Where column B matches Column O.
    =SUMIF($B$3:N35,O35,$N$3:N35)
    Q will have sum of column M, Where column B matches Column O.
    =SUMIF($B$3:N35,O35,$M$3:M35)


    So As expected the rows 10 to 31 have values of P, Q as 0, wherever O is null, but why is row 35, 37, 43 and later showing up values in Column Q, when it should be 0 ? And even if it is showing up, why 4, 6, 8 ... why not the actual SUM ?

    Please tell me the reason for this problem, since this excel issue is irritating me a lot. This issue just vanished when I put some value in H32:H39 , but why ?
    Attached Files Attached Files
    Last edited by palmist; 12-28-2011 at 07:22 AM. Reason: wrong excel Attached
    --
    This is Mr. Banerjee from India

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excel formula calculation sometimes gives errors

    Dear Mr. Bannerjee,

    See the Column Q in the attached file and confirm back if this is what you were looking for.

    I see a some improvement areas in your spreadsheet and will be happy to improve if you share some insight about it. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    12-28-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel formula calculation sometimes gives errors

    Thanks, Mr Dilip, this formula does help, since the values become zero again.

    But I was looking for the reason why they were having a non zero value at all and values less than 10, the sum (if it was) should have exceeded 1000 at any cost.

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel formula calculation sometimes gives errors

    I can't yet figure out why, but your formula is counting the number of empty cells in column H. I suspect it has something to do with the fact that your sum range is within your criteria range. You will see when adding something in one of the empty values in col H that the value in row 35 changes from 4 to 3

    EDIT you might also want to replace =IF(ISNA(VLOOKUP(B35,B36:D$5629,1,0)),B35,"") with =IF(countif(B36:B$5629,B35)=0,B35," ")
    Last edited by arthurbr; 12-28-2011 at 08:53 AM.

  5. #5
    Registered User
    Join Date
    12-28-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel formula calculation sometimes gives errors

    Thanks, Mr Arthur, for your suggestion, I did implement it now.

    And yes, it does count if the O35 matches anything in $B$3:N35 , but My query on that is why does it add the column S values instead of the column M or Column N (as mentioned in the formula).

    The problem may be seen by changing any of the values on rows S4:S9, which will immediately reflect on below rows !! (This does not happen after applying Mr. Pandey's new formula).

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excel formula calculation sometimes gives errors

    Also as you have asked that why the SUMIF is not working, below explanation my help:-

    SumIf syntax:-
    SUMIF(range, criteria, [sum_range])

    Details regarding sum_range :-

    The sum_range argument does not have to be the same size and shape as the range argument. The actual cells that are added are determined by using theupper leftmost cell in the sum_range argument as the beginning cell, and then including cells that correspond in size and shape to the range argument.
    For example:-
    If range is And sum_range is Then the actual cells are
    A1:A5 B1:B5 B1:B5
    A1:A5 B1:B3 B1:B5
    A1:B4 C1:D4 C1:D4
    A1:B4 C1:C2 C1:D4

    So, as you are using 13 columns in your range, then your sum_range also moved accordingly.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excel formula calculation sometimes gives errors

    Dear Banerjee,

    I would say once again and as shown by arthurbr, there are some opportunities to upgrade your worksheet with better formulas if you can share some details / logics which you want to apply. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Excel formula calculation sometimes gives errors

    The sum_range argument does not have to be the same size and shape as the range argument.
    That's true, but incurs the penalty of making the formula volatile.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excel formula calculation sometimes gives errors

    ya... you are correct shg..
    there are still some pain left but it may be a way to use it more dynamically.. Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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