Too many arguments for this function error

chrono2483

Board Regular
Joined
Aug 23, 2014
Messages
164
Office Version
  1. 2016
I am trying to use the following formula - to contain 2 IF statements:

=IFERROR(IF(OFFSET(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),4,3,,)="--:--",OFFSET(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),5,3,,),OFFSET(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),4,3,,)),if(offset(index($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),5,3,,)="--:--",offset(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),4,,,),offset(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),5,3,,)),"")


I get an error that I've entered too many arguments for this function. Is there any way to condense, while keeping the OFFSET formula? I thought an IF/OR might work, but not so much.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Can you use a helper column for this part:
MATCH($M4,$A$1:$A$5000,0)
rather than repeating it?
 
Upvote 0
You have 2 sets of results to return if the IFERROR finds an error in the first section.

=IFERROR(
IF(OFFSET(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),4,3,,)="--:--",OFFSET(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),5,3,,),OFFSET(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),4,3,,) )

If the first IF condition returns an error then the following will be evaluated
,if(offset(index($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),5,3,,)="--:--",offset(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),4,,,),offset(INDEX($A$1:$A$5000,MATCH($M4,$A$1:$A$5000,0)),5,3,,))

and this bit is surplus
,"")
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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