Need help to expand my look up range in a very long (and probably over complex) index formula with array

saraapple

Board Regular
Joined
Feb 3, 2020
Messages
148
Office Version
  1. 2010
Platform
  1. Windows
This is my formula which works!

{=IFERROR(INDEX('3.PASTE PARAGON 2'!$B$2:$E$346,SMALL(IF('3.PASTE PARAGON 2'!$B$2:$E$346=$C2,ROW('3.PASTE PARAGON 2'!$B$2:$E$346)-1),COLUMNS($K2:K2)),4),"")}

It basically changes data from a column to a row in a new sheet.
Data changes every day so this is updated in the sheet '3.PASTE PARAGON 2' my problem is the data in this sheet can go beyond row 346 - I want it to capture the whole sheet but when I change the B2:E346 to B:E the formula stops working.

I am currently pulling it apart to try and figure out where I have gone wrong and wondered if it was something simple I am not seeing?

Any help gratefully appreciated.
Sara
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,052
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=IFERROR(INDEX('3.PASTE PARAGON 2'!$B$2:$E$1000,SMALL(IF('3.PASTE PARAGON 2'!$B$2:$E$1000=$C2,ROW('3.PASTE PARAGON 2'!$B$2:$E$1000)-1),COLUMNS($K2:K2)),4),"")
 
Solution

saraapple

Board Regular
Joined
Feb 3, 2020
Messages
148
Office Version
  1. 2010
Platform
  1. Windows
Thank you for taking a look.
{=INDEX('3.PASTE PARAGON 2'!$B$2:$E$1000,SMALL(IF('3.PASTE PARAGON 2'!$B$2:$E$1000=$C2,ROW('3.PASTE PARAGON 2'!$B$2:$E$1000)-1),COLUMNS($K2:K2)),4)}
I took out the IFERROR and it gives me a #N/A

If I increase the E346 +1 its starts #N/A

The current data in my sheet ends at row 346 which has the be the reason - what if tomorrows data has 500 rows or less than 346 - this will cause my formula to fail?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,052
Office Version
  1. 365
Platform
  1. Windows
If you are getting a #N/A error, that would suggest you have that error in the original data.
 

saraapple

Board Regular
Joined
Feb 3, 2020
Messages
148
Office Version
  1. 2010
Platform
  1. Windows
You are right - there was a #NA line in my data.
Added and IFERROR so all my formulas can run and not cause problems to row 1000.
Thank you for pointing me in the right direction :)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
64,052
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Forum statistics

Threads
1,144,522
Messages
5,724,830
Members
422,581
Latest member
samiak

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