+ Reply to Thread
Results 1 to 5 of 5

Getting a Column with REF!'s to Sum?

  1. #1
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Question Getting a Column with REF!'s to Sum?

    Hi,

    I have been re-working a sheet from a book I've read (hence the file that I have attached is 99% values that I have pasted from part of the re-worked sheet and only an example of the formula I am having issues with) - in short, it had an example of a Markov Chain model for modelling an inning of a baseball game. The model was run with the @Risk add-in, using the RiskDiscrete function, which I re-worked into a nested if using the random number generating function (random numbers in column A).

    Basically the only thing, I haven't been able to re-work is how to sum up the runs generated in the H column? The model generates ref!'s when you get consecutive "yes"'s in column K (to denote the end of an inning). The end in J1, you can do with a Match, I just couldn't figure how to do something similar in J2 for column H (as the REF!'s generate a REF!)? Basically it should add up to 6 as per M2 (and the formula would be suitable etc). Sometimes the inning will run to over 100 lines (to give you an idea of how much it needs to vary).

    Any advice would be appreciated (or even nudges in the right direction).

    Thanks in advance,

    Runs_Problem.xlsx

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Getting a Column with REF!'s to Sum?

    Because sum function doesn't take errors.

    Enter this formula with Ctrl + Shirt + Enter keys together

    =SUM(IFERROR(H4:H203,0))

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Getting a Column with REF!'s to Sum?

    Put this array* formula in J2:

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


    *An array formula needs to be confirmed using the key combination of Ctrl-Shift-Enter (CSE) rather than the usual <Enter>. If you do this correctly then Excel will wrap curly braces { } around the formula when viewed in the formula bar, but you should not type these yourself. If you need to amend the formula you will need to use CSE again to confirm the amendment.

    Hope this helps.

    Pete

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Getting a Column with REF!'s to Sum?

    Another option is SUMIF with just ENTER

    =SUMIF(H11:H1000,">0")

    to avoid volatile, use

    =SUMIF(H11:H1000,">0",H11:H1000)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Re: Getting a Column with REF!'s to Sum?

    Thanks all. Everything would be spot on that everyone has suggested - I posted this without being as thorough as normal though, and actually had a quick look around whilst on my lunchbreak today and I ended up going with this:

    =SUMIF(H57:H256,"<>#REF!")

    The H numbers match the numbers off of my actual sheet. The formula came off a similar question someone had asked a couple of years ago.

    Thanks to everyone for answering though.

+ 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