I need to make an excel spreadsheet that accepts user input in one of two columns on the sheet. Whichever column does not have the manual input needs to calculate its value. To illustrate:
In this picture, there is a relationship between the three columns. Total Price = (Price / Unit) * (Unit Count).
The users of my spreadsheet will do one of two things:
- They will manually enter a value for "Price / Unit." If this happens, the "Total Price" needs to calculate (Price / Unit * Unit Count).
- They will manually enter a value for "Total Price." If this happens, the "Price / Unit" needs to calculate (Total Price / Unit Count).
Is there a formula that will enable this? Maybe an "If-C1-is-a-formula" function?? I'm thinking this is impossible.
EDIT: Macros are a no-go for me. Sorry for not mentioning it sooner. I will be developing this with Apache POI through Java, which doesn't allow for the creation of macros.