LucreMoneyWonga
New Member
- Joined
- May 22, 2023
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
Hi, I am pretty new to Excel and am trying to create a macro to provide the risk bracket (difference between two share prices) for some analysis I am doing.
I currently have two formulas that work perfectly, but I enter them separately depending on the direction of the share price movement.
I enter "S" or "L" for a short or long price difference (short meaning down, long meaning up). I then have two numbers representing the top and bottom of the price range.
I use this formula if the price is going down (S11 and Y11 being the prices in question)
=IF(Q11="S",S11-Y11)
and change it to this formula if the price is going up (note the pricing cells have changed places, as I don't want a negative number returned)
=IF(Q16="L",Y11-S11)
My question is can I combine these formulas so I can just use one formula and copy it down the spreadsheet, and if so, can I enter a third condition where "N/A" is returned if there is no price change, rather than 0 ?
Thanks very much for any help
I currently have two formulas that work perfectly, but I enter them separately depending on the direction of the share price movement.
I enter "S" or "L" for a short or long price difference (short meaning down, long meaning up). I then have two numbers representing the top and bottom of the price range.
I use this formula if the price is going down (S11 and Y11 being the prices in question)
=IF(Q11="S",S11-Y11)
and change it to this formula if the price is going up (note the pricing cells have changed places, as I don't want a negative number returned)
=IF(Q16="L",Y11-S11)
My question is can I combine these formulas so I can just use one formula and copy it down the spreadsheet, and if so, can I enter a third condition where "N/A" is returned if there is no price change, rather than 0 ?
Thanks very much for any help