Can this be simplified

Jtvining

New Member
Joined
Jun 23, 2011
Messages
5
=IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,14),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,15),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,16),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,17),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,18),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),0)))))

Can this be simplified into a shorter formula?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What is this formula meant to do? Can you please explain the logic in it? (Some sample data will help as well)
 
Upvote 0
it looks up a date and if it matches puts the corresponding value in the cell. if not it moves to the next column to look for the match and so on and so forth.

the problem is that the lookup date is not a cloumn heading it is entered in a row above what the match brings back that is why the offset of -1.

the formula works but when spread accross the amount of cells i need it really slows down the process
 
Upvote 0
because hlookup requires a fixed range while the range i am using is dependent on the match in the very first if statment which is then offset to return the date. this date is compared to the heading date on another sheet and if this matches then it pulls the number from the corresponding column on another sheet
 
Upvote 0
Can you please provide some data so we can easier visualize what your requirements are?
 
Upvote 0
Try

Code:
=IF(ISNUMBER(MATCH(B$1,OFFSET(INDEX('Sheet1'!$A:$A,MATCH($A4,'Sheet1'!$A:$A,0)),-1,14,1,5),0)),INDEX('Sheet2'!$D$1:$D$1000,MATCH($A4,'Sheet2'!$A:$A,0)),0)
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

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