IF for 2 different sheets

cogumelo

Board Regular
Joined
Mar 23, 2006
Messages
175
Office Version
  1. 365
Platform
  1. Windows
Hi.

I thought this would be pretty straightforward but i've come around a few problems with IF.

Code:
IF($BY$1=HLOOKUP($BY$1;sheet1!1:1;1;0);OFFSET(sheet1!$B$1;MATCH(A2;sheet1!$A$2:$A$1000;0);MATCH($BY$1;sheet1!$C$1:$GA$1;0))+BX2;OFFSET(sheet2!$B$1;MATCH(A2;sheet2!$A$2:$A$1000;0);MATCH($BY$1;sheet2!$C$1:$GA$1;0))+BX2)

What i'm trying to do here is:

IF($BY$1=HLOOKUP($BY$1;sheet1!1:1;1;0);

If sheet1 has the value on BY1 then:

OFFSET(sheet1!$B$1;MATCH(A2;sheet1!$A$2:$A$1000;0);MATCH($BY$1;sheet1!$C$1:$GA$1;0))

So far works fine if it finds the value on sheet1.

However if the value is not on sheet1 i need to do the same on sheet 2

OFFSET(sheet2!$B$1;MATCH(A2;sheet2!$A$2:$A$1000;0);MATCH($BY$1;sheet2!$C$1:$GA$1;0)))

But all i get is the N/A error.

Can anyone help out?

Putting it simple what i'm trying to do is get a value from the sheet that has the title i'm searching.


thx in advance,

cogumelo
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,136,878
Messages
5,678,326
Members
419,756
Latest member
vincent86kapelski

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
Top