Why replace the formula with a User Defined Function?
Why replace the formula with a User Defined Function?
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
You could simplify the formula:
=CHOOSE(COUNT(A2:C2)+1, "", "", AVERAGE(A2:C2), AVERAGE(A2:B2))
Entia non sunt multiplicanda sine necessitate
Thanks for fixing my topic, I will definately be more careful in the future. I've been trying to figure this out all day and I've gotten annoyed so I overlooked my post.
The reason I want to replace the formula is because I have to use the formula over several different documents, all without consistent formatting. Which means to edit each formula for each sheet, I have to replace 12 cell references and scroll back through at least 36 cells in a row. Whereas If I replace it with the UDF, I will only have to replace 3 cell references each time. The data includes numbers for each month between 2010 and 1990, so the size of the spreadsheet is huge and the difference between making 12 and 3 cell references makes a huge difference in time. Doing this can greatly increase my productivity and thus increase the amount of non-working I have to do at work
I'm having to average just 2 numbers that can be seperated throughout the spreadsheet, not a range of numbers.
Last edited by aussiemcgr; 06-17-2010 at 03:25 PM. Reason: More Information
=choose(count(a2,b2,c2)+1, "", "", average(a2,b2,c2), average(a2,b2))
You'd have to show me an example of that formula returning TRUE.
Not sure how I got TRUE, but I'm not anymore.
Regardless, the formula isnt completely simplified. This is what it should be:
I do have a question about it though. When is![]()
=CHOOSE(COUNT(B1,C1,C1)+1, "", AVERAGE(B1,D1), AVERAGE(B1,C1,D1), AVERAGE(B1,C1))
used?![]()
AVERAGE(B1,C1,D1)
=CHOOSE(COUNT(A1,B1,C1)+1, "", "", AVERAGE(A1,B1,C1), AVERAGE(A1,B1)) (mine)
=CHOOSE(COUNT(B1,C1,D1)+1, "", AVERAGE(B1,D1), AVERAGE(B1,C1,D1), AVERAGE(B1,C1)) (yours)
Your formula averages B1 and D1 when there's only one number among the three cells, which doesn't follow your prior formula.
When any two of the three cells have numbers. The non-numeric value is ignored by AVERAGE.When is AVERAGE(B1,C1,D1) used?
Last edited by shg; 06-18-2010 at 11:11 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks