Too many arguments for this function error

chrono2483

Board Regular
Joined
Aug 23, 2014
Messages
157
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.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,349
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Can you use a helper column for this part:
MATCH($M4,$A$1:$A$5000,0)
rather than repeating it?
 

konew1

Well-known Member
Joined
Oct 17, 2007
Messages
2,287
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
,"")
 

Forum statistics

Threads
1,082,139
Messages
5,363,363
Members
400,731
Latest member
Jackserver

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top