+ Reply to Thread
Results 1 to 10 of 10

If and Countif Formula not Working

  1. #1
    Registered User
    Join Date
    02-08-2007
    Location
    Maine, USA
    MS-Off Ver
    Office 365
    Posts
    82

    Question If and Countif Formula not Working

    Several weeks ago, with the help of several, I got a working formula for the distribution of funds.
    As a reminder the goal is funds to be distributed based on full and half partners. The total for distribution obviously needs to equal the total distributed. When there is a half partner, the remaining half partner share needs to be distributed to all in a manner which results in those funds being distribute in a ratio or percentage that ends totaling the half share. (D15 = D22 in the file attached)

    As you can see with the existing number of partners the formula works. but if you add a partner, full or half (in yellow area), total for distribution and total distributed do not equal each other. I have checked the ranges for the formulas and do not see a reason for this. What have I missed???

    Current formula is:
    IF($C25="",0,IF(COUNTIF($C$25:$C$42,"h")=0,D$14,IF($C25="",0,IF($C25="h",D$15+D$20/COUNTIF($C$25:$C$42,"h"),IF(C$25="f",D$14+D$19/COUNTIF($C$25:$C$42,"f"),0)))))
    Thanks
    Attached Files Attached Files
    Last edited by danbl; 05-06-2019 at 08:24 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,626

    Thumbs up Re: Formula not Working - Revisited

    Title adapted as per forum rules
    Last edited by Pepe Le Mokko; 05-04-2019 at 03:11 AM.

  3. #3
    Registered User
    Join Date
    02-08-2007
    Location
    Maine, USA
    MS-Off Ver
    Office 365
    Posts
    82

    Re: If and Countif Formula not Working

    note change

  4. #4
    Registered User
    Join Date
    02-08-2007
    Location
    Maine, USA
    MS-Off Ver
    Office 365
    Posts
    82

    Re: Formula not Working - Revisited

    Does revision comply with rules?

  5. #5
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: If and Countif Formula not Working

    Hopefully your title change is sufficient.

    From what I can see, adding any number of Full partners works (for column D; the other columns need the ranges adjusted). Once you start adding Half partners, the issue arises. I believe it has to do with the way you're calculating shares value. You're dividing the amount for distribution by the total number of people, regardless of share. This gives you a full share value (in theory), which you then cut in half for the half share value. This ends up leaving money on the table, because the rest of the calculations are based on the assumption that there will always be a 1 half share left over.

    I think you'd be better off dividing the amount for distribution by the total number of half shares. This would give you a half share value, which you could then double to get the full share value. This will always distribute all of the money, and will not require a calculation to distribute a remaining half share, because there won't be one.

    Here's an example:
    You have $100 to distribute between 3 full shares and 2 half shares. Your method would calculate the full share at $20 ($100/5), and the half share at $10 ($20/2). If you add those up, you get $80 (3*20 + 2*10). That leaves $20 left over, which is a full share, not a half share.

    What I'm suggesting would work this way: Calculate the half share at $12.50 ($100/((3*2)+2)). Calculate the full share at $25 ($12.50*2). If you add those up, you get $100. There's no leftover to worry about.
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  6. #6
    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: If and Countif Formula not Working

    Perhaps you'll be more successful in convincing him than I was: https://www.excelforum.com/excel-for...ml#post5092941
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: If and Countif Formula not Working

    Hah, I thought this looked familiar. I remember typing up something similar last time, and then realizing you had already posted your recommendation.

    Always calculate based on the value of the smallest share, and then multiply up. This I learned from Nathan Lowell's fantastic Trader's Tale series. (Available as a free podcast for anyone interested. Hope this doesn't count as advertising or anything!)

  8. #8
    Registered User
    Join Date
    02-08-2007
    Location
    Maine, USA
    MS-Off Ver
    Office 365
    Posts
    82

    Re: If and Countif Formula not Working

    Melvosh ….

    thanks for the reply and suggestions. It makes sense, I just need to spend some time working on changing the other calculations.

  9. #9
    Registered User
    Join Date
    02-08-2007
    Location
    Maine, USA
    MS-Off Ver
    Office 365
    Posts
    82

    Re: If and Countif Formula not Working

    Melvosh

    Attached is the data with your suggested formula. This works with the current but again when you add a Full or Half partner the totals do not equal. What did I miss??
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    02-08-2007
    Location
    Maine, USA
    MS-Off Ver
    Office 365
    Posts
    82

    Re: If and Countif Formula not Working

    My apologies ……………….. the problem appears to be, I did not expand the total ranges properly!!

    Thank you to all.

+ 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. Read Only Revisited
    By Billy Spivy in forum Excel General
    Replies: 7
    Last Post: 09-29-2017, 09:52 AM
  2. [SOLVED] Macro to run formula based on a range of data in some rows of a column REVISITED
    By Pro Sherman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2013, 11:32 PM
  3. total while Incorporating IF function Formula - Revisited
    By mbnewton1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-22-2013, 03:39 PM
  4. [SOLVED] array revisited
    By RobcPettit@yahoo.co.uk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2006, 03:40 PM
  5. Last row, last column revisited
    By David O. Antillon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2005, 12:05 AM
  6. 1st, 2nd, 3rd Place Revisited
    By Ronald Hooper in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-12-2005, 11:00 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