Error handling with Index-Match nested functions

n8te

New Member
Joined
Feb 13, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone,

I have an issue which I'm sure won't be a very difficult one to resolve. I'm using in a table (t_b) an index-match function to return values that are stored in another table (t_a). Such as:

Excel Formula:
 {=INDEX(t_a[Price];MATCH(1;([@[P_PartialName]]=t_a[Partial Name])*([@[units]]=t_a['# units]);0))}

It works fine. However, this famous table A is a table that should be populated. As users begins with the workbook, this table only has one row (and they can then add more). When the table only contains one row, then the index/match does not work. How can I still force Excel to find the only value contained in the correspondent column?

Thanks in advance everyone.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi *n8te,

Can you add a check to how many rows are in the table before trying the index/match? For instance, put the INDEX/MATCH inside of an IF statement that does a COUNT OR COUNTA of t_A{Price]. If the count is greater than 1, INDEX/MATCH, else returns the only row or something else. I am not sure I follow exactly the structure of your data so you may have to adjust.

An alternative to index/match with two criteria is the FILTER function. It has quickly become my favorite.

Hope that helps,

Doug
 
Upvote 0
Solution
Thanks. This was indeed an easy solution. I don't know why I didn't tought about it. Thanks anyway :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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