Sample.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Sample | Title | Column1 | Column2 | Column3 | Column4 | Column5 | ||||
2 | Red | 5 | 5 | 5 | 4 | -0.20 | |||||
3 | Blue | 7 | 6 | 4 | -0.14 | ||||||
4 | Yellow | 3 | 5 | ||||||||
5 | Green | 9 | 3 | 4 | -0.67 | ||||||
6 | Orange | 11 | 2 | ||||||||
7 | |||||||||||
8 | |||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H2:H6 | H2 | =IFERROR(IF(G2,(G2-F2)/F2,(E2-D2)/D2),"") |
So I am able to figure out the first condition with the IF function, and I have been playing around with AND/OR for the second condition but have not been able to add onto the current formula to achieve the results I'm looking for.
Using table above (table name is called "Sample")
My conditions are:
(G2-F2)/F2 BUT IF G2 is blank use (E2-D2)/D2) (which I have achieved with the current formula in the table)
BUT IF E2 AND F2 is blank use (G2-D2)/D2 instead.
How could I write up a formula to meet these conditions?