I have an excel file which refreshes in real time (nearly every 1 second). A function is called as an excel formula which throws a popup on a particular condition being met. My interest lies in identifying only when a condition is met for the first time. Once condition is met, I do not want function to show popup repeatedly. However, because excel is refreshing fast in real time, the function condition keeps getting met repeatedly and hence popup comes again and again after pressing Ok. Is there a way to avoid this? I am thinking of passing a flag (excel cell value) as well as an input to the function. Is there a way to change the flag (excel cell value) from within function? Or any other solution without making calculation manual?