Blog reader Richard asks through email:
I’m a non-programing user of Excel. I import stock prices, using what is called ( I believe) a dde link, into my spreadsheets,from a trading program.
I would like to add a feature to my spreadsheets that, like conditional formatting, alerts me to a price change in a cell, but with a sound or .wav file, instead of a color change of that cell.
Something like: =if b4 =>10.00, play .wav
Is there something you can help me with? I am using office 2003 pro.
You can write a vba macro that can create a windows media control (active-x) component and use it to play a .wav (or mp3) file when a certain event happens. But it would be both time consuming and difficult to implement.
The simple solution is of course “beep” whenever a certain condition is met, in this case, the stock price getting changed.
Thankfully, we have a vba command to do just the job, Beep, will play a standard windows beep sound when called. So all you have to do is, create a user defined function shown below:
Function beepNow()
Beep
End Function
And use it in your excel sheet like: =IF(C2<>C3,beepNow(),""). So when the data gets dynamically refreshed, you would hear a ding if C2 is not equal to C3.
What would use beepNow() for?













11 Responses to “Who is the most consistent seller? [BYOD]”
The Date column in the sample file is Text not Dates
[…] http://chandoo.org/wp/2015/02/18/calculating-consistency-in-excel/?utm_source=feedburner&utm_med… […]
Great Chandoo. Keep it up, Looking forward more from BYOD..
Thanks
With Excel 2013 the pivot table could be connected to the data model which provides a distinct count.
This will do for invoice count
=COUNTIF(F:F,H12)
Instead of
=COUNTIFS(sales[SELLER],$H12)
Excellent document. How did you make the last graphic? Witch app. Thanks for answer.
Can someone tell me what =countif(sales[date],sales[date]) is counting? The value is 19. Its found in the =SUMPRODUCT(IF(sales[SELLER]=H12,1/COUNTIFS(sales[SELLER],H12,sales[date],sales[date]),0))
Hi Chris,
=countif(sales [date],sales[date]) function is counting the unique dates in the table.
Vândalo
Excellent document!
Can you explain more about the calculation on Weighted consistency? More specific the small number is 0,00001 ?
How come the number should be smaller if there is more sellers?
Hi,
Not understood this formula: {=SUMPRODUCT(IF(sales[SELLER]=H12,1/COUNTIFS(sales[SELLER],H12,sales[date],sales[date]),0))}
Please explain.
Thanks.