How to combine two if/or formulas (separately)

valmir

Active Member
Joined
Feb 10, 2021
Messages
267
Office Version
  1. 365
Platform
  1. Windows
Hello everyone
After checking lots of videos on this type of formula on youtube, I couldn't find anyone explaining this particular matter. It looks like everyone teaches exactly the same thing for each particular topic on youtube.
These are the two formulas that I want to combine. Please note that each one of them has a different return, that's where I'm stuck!
Excel Formula:
=IF(INDIRECT("'"&$A$3&"'!HK5")=INDIRECT("STATS1!D3");INDIRECT("'"&$A$3&"'!HL5");INDIRECT("'"&$A$3&"'!HK5"))
Excel Formula:
=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5"));INDIRECT("STATS1!D3");INDIRECT("'"&$A$3&"'!HL5"))
I understand that the formula should be a if/or formula? Because I can come across any of both scenarios! Thanks!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Your two formulae have the form:

=IF(INDIRECT("'"&$A$3&"'!HK5")=X; A; B)
=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5")); C; D)

It's not totally clear how you want to combine these, but my guess would be:

=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5")); C ;IF(INDIRECT("'"&$A$3&"'!HK5")=X; A; B))
 
Upvote 0
Your two formulae have the form:

=IF(INDIRECT("'"&$A$3&"'!HK5")=X; A; B)
=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5")); C; D)

It's not totally clear how you want to combine these, but my guess would be:

=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5")); C ;IF(INDIRECT("'"&$A$3&"'!HK5")=X; A; B))
Hello Sir. Sorry for the late reply. I tried to use this formula but it gives me an error. The error points to the letters C, X, A and B which I have no idea what they mean!
 
Upvote 0
I was using A, B, C, D and X just to illustrate the structure of your formulae, e.g. A stands for INDIRECT("'"&$A$3&"'!HL5")

It's not clear how you want to combine your two formulae, but I'm guessing:

Excel Formula:
=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5"));INDIRECT("STATS1!D3");IF(INDIRECT("'"&$A$3&"'!HK5")=INDIRECT("STATS1!D3");INDIRECT("'"&$A$3&"'!HL5");INDIRECT("'"&$A$3&"'!HK5")))
 
Upvote 0
I was using A, B, C, D and X just to illustrate the structure of your formulae, e.g. A stands for INDIRECT("'"&$A$3&"'!HL5")

It's not clear how you want to combine your two formulae, but I'm guessing:

Excel Formula:
=IF(ISBLANK(INDIRECT("'"&$A$3&"'!HK5"));INDIRECT("STATS1!D3");IF(INDIRECT("'"&$A$3&"'!HK5")=INDIRECT("STATS1!D3");INDIRECT("'"&$A$3&"'!HL5");INDIRECT("'"&$A$3&"'!HK5")))
Ok let me explain and please correct me if I'm wrong: The IF formula in excel allows for multiple conditions, however there is just a single input for the "value if true" and "value if false" values. In my case, I have a scenario with two conditions in which the "value if true" and "value if wrong" values for each of them is different. Is there a syntax for such case? I have yet another case with three different conditions, each of them with its own "value if true" and "value if wrong" values. If there is a syntax for my examples, please let me know. I will be able to work from there! The above formula didn't work!
 
Upvote 0
I have a scenario with two conditions in which the "value if true" and "value if wrong" values for each of them is different. Is there a syntax for such case? I have yet another case with three different conditions, each of them with its own "value if true" and "value if wrong" values.
This is the first time you've mentioned three conditions. We can only guess what you want unless you provide more detail.

At the moment, you have two formulae, which in structure (using A, B, C etc just to simplify the illustration) do this:

Formula1
If Value = X then A
If Value <>X then B

Formula2
If Value is blank then C
If Value is not blank then A

I put them into one formula which does:
If Value is blank then C
If Value is not blank then
- If Value = X then A
= If Value <> X then B

If that "didn't work", please let us know what logic you want to follow?
 
Upvote 0
This is the first time you've mentioned three conditions. We can only guess what you want unless you provide more detail.

At the moment, you have two formulae, which in structure (using A, B, C etc just to simplify the illustration) do this:

Formula1
If Value = X then A
If Value <>X then B

Formula2
If Value is blank then C
If Value is not blank then A

I put them into one formula which does:
If Value is blank then C
If Value is not blank then
- If Value = X then A
= If Value <> X then B

If that "didn't work", please let us know what logic you want to follow?
Ok thanks for the explanation and sorry for lack of clarification. I'm a bit slow so I'll take some time to follow the logic you explained and try out the formula. I'll try and see if it works. Once again thanks a lot!
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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