Trying to add multiple IF if first cell is blank use another cell, but if that cell is blank use another cell.

floW_5

New Member
Joined
Jan 4, 2024
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Sample.xlsx
ABCDEFGHI
1SampleTitleColumn1Column2Column3Column4Column5
2Red5554-0.20
3Blue764-0.14
4Yellow35 
5Green934-0.67
6Orange112 
7
8
Sheet1
Cell Formulas
RangeFormula
H2:H6H2=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?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Sample.xlsx
ABCDEFGHI
1SampleTitleColumn1Column2Column3Column4Column5
2Red5554-0.20
3Blue764-0.14
4Yellow35 
5Green934-0.67
6Orange112 
7
8
Sheet1
Cell Formulas
RangeFormula
H2:H6H2=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?

Sample.xlsx
ABCDEFGHI
1SampleTitleColumn1Column2Column3Column4Column5
2Red5554-0.20
3Blue764-0.14
4Yellow35 
5Green934-0.67
6Orange112 
7
8
Sheet1
Cell Formulas
RangeFormula
H2:H6H2=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?
Hi, mine might be a long cut but i understand it this way

IF(AND(E2="",F2=""),(G2-D2)/D2,IF(G2="",(E2-D2)/D2,(G2-F2)/F2))
 
Upvote 0
Solution
like this ??

Excel Formula:
=IFERROR(
IF(G2<>"",(G2-F2)/F2,
IF(G2="",(E2-D2)/D2,
IF(AND(E2="",F2=""),(G2-D2)/D2))),"")
 
Upvote 0
like this ??

Excel Formula:
=IFERROR(
IF(G2<>"",(G2-F2)/F2,
IF(G2="",(E2-D2)/D2,
IF(AND(E2="",F2=""),(G2-D2)/D2))),"")
This still leaves H4 and H6 blank unfortunately. I appreciate the help though. Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top