![]() |
#2
|
||||
|
||||
![]()
I too found it difficult to get a worksheet formula that was easy to maintain and in the end gave up and wrote a user-defined function to do it instead.
In the attached, I've worked out what I think the answer should be in cell E34 as a cross-check. You use the function as follows, (see cell F34): =Commission(C2:C33) It counts numbers from the top (if there's a zero it calls that a sale for counting purposes, but blanks and text are not counted). You can use it in a different way, to include multiple non-contiguous areas like: =Commission((C2:C9,C12:C16,C19:C27,C29:C31)) Two things to note here: 1. You need the double parenthesesTo show you the importance of these 2 points see cells H34:I34 which process the same cells but return different values. Also see M9:M11. There's a comment in the code for the function syaing you can add more threholds, for example you could change it to: Code:
Thresholds = Array(0, 11, 26,101) CommRates = Array(0, 0.1, 0.15, 0.5) As an aside, your formula for counting sales in cell C34 is dangerous because it counts cells containing anything at all, including text. I put text in cell C3 to demonstrate and a simpler and more reliable formula for this in cell C35. All academic since it's not used to calculate the commission. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ann.acornacchio | Excel | 4 | 12-31-2016 05:40 PM |
![]() |
mcronin | Excel Programming | 3 | 06-15-2016 09:44 AM |
Copy column entries on value | Guloluseus | Excel | 3 | 01-05-2015 08:28 PM |
Greater than today at a specific time | cangelis | Excel | 6 | 10-01-2014 08:48 AM |
Creating Calendar Entries using Specific Times | ndd811818 | Outlook | 0 | 03-04-2013 10:56 AM |