# Posts by darkyam

Re: Replace Second Word Of A String

=LEFT(AI1,FIND(" ",AI1)-1)&" Monday"

Re: Sum Data By Dates

If you don't want to use a pivot table, you could also use array formulas.
If we call the cell that has the start date A2, the cell with the end date B2, the cell with the letter you want to sum by C2, and your range of data (not including headers) A5:C17, then you can use the following formulas:
1. =SUM((A5:A17>=A2)*(A5:A17<=B2)*(C5:C17))
2. =SUM((A5:A17>=A2)*(A5:A17<=B2)*(B5:B17=C2)*(C5:C17))
For both of these formulas, you will have to press Ctrl+Shift+Enter to confirm them, as they are array formulas.
3. I would suggest formatting the start and end dates as dates, so that all numbers entered into them are automatically formatted as dates. You can also use data validation to allow only dates in those cells. If the start date is greater than the end date, if the end date is blank, or if both cells are blank, both of these formulas will automatically return 0. If start date is blank, it will return the history of your range through the end date.

Re: Formula With Text Function Rounding Up Result

Hi, Dave. You're right on that, but replacing the "0" with a number format, "0.0", etc. gives "7.5" and "7" is needed. The "0" formatting works, as long as the RoundDown takes place first.

Re: Formula Rounding Up - Unwanted

Try =TEXT((ROUNDDOWN(SUM(D98,D117,D136))/12,0),"0"&...

Re: paste values no value

You don't need a macro to do this. When I try to do a similar formula (can't find where your formula is on this spreadsheet) where a cell in a range evaluates to "", it does not count it when I do a Count(range) formula. However, I have noticed this issue in Offset formulas for some reason and I get around it by Count(range)-Countif(range,"").

Re: Caculate Number To Reach Target

Ahhh, now I think I have it. So, you want to take into account not only the moving target of the forecast, but also your group's current pace compared to what is needed, right?
If so, then I have modified column G to show the the number from E if D is filled in (C times the formula I put in H4 if not) and added the sum of the difference between E and F for all previous days divided by the count of days left. For example for Dec. 6, 450 came in, meaning 129 (technically 128.90) had to be done. For Dec. 3-5th, 450 items needed to be completed and 438 were completed, leaving a difference of 12. This difference was divided by the 26 days from Dec. 6-31 and added to the 128.9, leaving a result of 129.32 (both would, of course, show up as 129).
In other words, if you are very close to your target, the numbers in G will match up very closely with E.
I made a few other minor changes that you can delete if you want (deleting H4 will require the original formula for determining items to be completed to be added back to all necessary cells, so hiding it is recommended rather than deleting). I added a moving forecast in H2. This takes the original forecast, subtracts the amounts in C for days that have happened (i.e. for which amounts exist in D) and adds the sum of D. Cell J4 has a moving Target based on the Moving Forecast.
Cell H3 shows whether your moving forecast is within 10% of the original forecast.
Cell H4 is a shortening of the formula for determining necessary items to be completed. Since everything but the forecast numbers in that formulas are fixed, it makes no sense to repeat the formula, so I replaced all instances of it with the forecast times H4. The big advantage is that, should you ever need to change this formula, you can do it once rather than a bunch of times.

## Files

I updated the ranking formulas to allow for two places having the same %. Since it appears that Sheet 2 is formatted for public viewing, I hid the rankings table (column Q has all the data; I whited it out and hid it). Sheet 1 now shows the rankings by percentage.

## Files

Re: Count Between 2 Numbers

If the formula returned as 100%, it sounds like a formatting issue (as 100% is the equivalent of 1). Right click on that cell and choose format cells, then go to the Number tab and select Number as the format.

Re: Caculate Number To Reach Target

The formulas currently in the sheet I understand. I apologize for not being more clear in my questions. Is Inbound to be added to Completed BC, and if not, how does it interact with Completed BC? The reason I ask is that it seems clear from the formatting of the sheet that you want a number (and only one number) for each day and, as I interpret it, that number is a target for just Completed BC for what you have to hit that day to achieve your monthly goal. As a minimum, technically, you could do nothing for a day, and it would just increase the pace you would need to maintain for the rest of the month. If I need to add Inbound to BC, that's a very easy change to make. The formula in H9 would simply become =((\$F\$2-SUM(\$G\$9:G9))+(\$C\$3-SUM(\$D\$9:D9))/COUNTA(B10:\$B\$37) and you could drag that down.

If you do not want the values showing up in column H until G and (possibly) D are filled in, adding a simple IF statement can have them evaluate as blanks until values are entered.

Re: Formula With Multiple Criteria

How exactly are Inbound and BC related (I'm not familiar with the term BC)? What I did does not take into account the inbound part because it was unclear how that related to BC. Right now, it is just based off completed BC (and would thus update with each value put into G for that day).

Re: Formula With Multiple Criteria

I based the formulas in column H off of Completed BC. The formula in H returns the BC needed per day to finish the task as of the end of that day. For example, on row 9, it takes Target BC minus 133 completed and divides the result by the 28 days left in the month. If you were looking to base it on multiple columns, could you please be more specific about precisely what you want the formula to evaluate?

## Files

Re: Calculate Shortest Distance From Coordinates

I was able to modify the formulas a little bit and shorten this to only two additional columns. If you want this as only one or two cells, your best bet is probably some VBA code.

## Files

Re: Sum If-function With More Than One Criteria

You could also use an array formula (remember to hit Ctrl+Shift+Enter after entering the formula):
=SUM((Country="Sweden")*(Year=2005)*(Value))
You can replace "Sweden" and 2005 with cell references.

Re: Scatter Chart Coloration Tied To Cell Values

You, sir, are absolutely brilliant. I'm constantly amazed that sites like this have people like you willing to help twits like me out of the goodness of your hearts.

Re: Scatter Chart Coloration Tied To Cell Values

I based it off named ranges, so that it will adjust depending on how many rows are shown in columns H:K. The SERIES formula is =SERIES(Sheet1!\$I\$1,'test data2.xls'!Conversion,'test data2.xls'!SessionDuration,1,'test data2.xls'!PageViews).

Re: Checkboxes To Delete From A List

Another possibility, if you're not set on the idea of a checkbox object, is to put an "X" or, if you would rather have a check mark, a lower-case "a" with the font changed to Marlett, in column A instead of the checkbox. Then adjust your macro to read column A for the "X" or "a" and delete accordingly, so that when the row is deleted, the "X" or "a" goes with it.

Re: Scatter Chart Coloration Tied To Cell Values

By killing the charts, I was able to get the size down low enough. I left the macros in question in, but with the one I removed, the values in column M have to be changed manually (each true/false determines whether that row shows up in a chart that is created). Thanks for your help on this and patience with a humble VBA neophyte. ## Files

Re: Scatter Chart Coloration Tied To Cell Values

With the 2 modules and the chart on there, even deleting the other macro in the spreadsheet and all but four rows of data still leaves me 12kb high after zipping it up.

Re: Scatter Chart Coloration Tied To Cell Values

I tried, but the sheet is 660kb (490kb zipped) and the upload limit is 48kb. Is there a way to compress this so I can upload it? Thanks.

The idea of getting a scatter chart to have a smooth spectrum from http://www.ozgrid.com/Excel/xy-scatter-color.htm is brilliant, but there is a slight problem I am having with it. The number of points possible in the chart determines the color, rather than the values of cells. I have a table with 100 rows and the chart is based off data from that table; however, instead of using cell references in SERIES, I have named ranges, as part of the table returns a shortened list of values based on user-selected parameters.
In short, this means that if only 7 values are returned in this shortened table, the coloration sees 7 values out of 100 and goes only 7/100ths of the way from red to green. Is there a way to get the coloration based on a certain value in the worksheet for that row? For example, if I have a list of test scores ranging from 0% to 100%, can I get the same coloration to show for a score of 88%, regardless of whether one record is selected or all of them?
Also, if I wanted a user to be able to easily change the parameters of the spectrum so that they could see a spectrum of scores from 50% to 100%, can I get the macro to look these values up from the worksheet?
There are two modules in what I am using now, the class module is called CSpectrum and reads:

The other module is called MSpectrum and reads:

Thanks!