To count the number of days a stock price is higher than another, you need access to historical price data for both stocks. Here's a step-by-step approach using Excel:
- Gather the historical price data for the two stocks you want to compare. This data should include the date and corresponding price for each day.
- Create two columns in your Excel spreadsheet: one for the date and one for the price of the first stock. Enter the data accordingly.
- Repeat step 2 for the second stock, creating another column for its date and price.
- In a new column, subtract the price of the first stock from the price of the second stock for each corresponding date. This will give you the difference in prices.
- Create another column where you compare the difference in prices to zero using an IF statement. If the result of the subtraction is positive (i.e., the second stock's price is higher), mark it as "1" or any indicator you prefer. Otherwise, mark it as "0".
- Add up all the "1" values in this new column, which will give you the count of days where the second stock's price was higher than the first stock.
By following these steps, you can calculate the number of days the stock price of one company exceeds the other.