+ Reply to Thread
Results 1 to 4 of 4

Error Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 argum

  1. #1
    Registered User
    Join Date
    06-12-2015
    Location
    Madison WI
    MS-Off Ver
    2010
    Posts
    52

    Error Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 argum

    "Error: Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 arguments."

    I'm getting that error for this formula:

    =IF(B3=1,B46,IF(B3=2,C46,IF(B3=3,D46,IF(B3=4,E46,IF(B3=5,F46,IF(B3=6,G46,IF(B3=7,H46,IF(B3=8,I46,IF(B3=9,J46,IF(B3=10,K46,IF(B3=11,L46,IF(B3=12,M46),("ERROR"))))))))))))

    How can i re-write this to work?

    Thank you in advance!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Error Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 a

    How about this?

    =IFERROR(INDEX($B$46:$L$46,,B1), "ERROR")
    If posting code please use code tags, see here.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Error Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 a

    Try =IF(AND($B$3>=1,$B$3<=12),INDEX($B$46:$M$46,1,B3),"ERROR")

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,682

    Re: Error Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 a

    you were given two good answers but just an FYI the problem in your formula is here IF(B3=12,M46),("ERROR"))))))))))))
    it should look like this... previous part of formula then IF(B3=12,M46,"ERROR"))))))))))))
    if you try to use a nested IF / THEN formula in the future.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 08-31-2017, 02:52 PM
  2. Wrong number of Arguments error on macro - help!
    By KarlaB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2015, 01:30 PM
  3. [SOLVED] Excel VBA Compile Error wrong number of arguments
    By gjwilson1216 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-24-2013, 03:08 PM
  4. [SOLVED] VBA - Compile Error - Wrong number of arguments
    By Janto724 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-28-2013, 06:04 AM
  5. [SOLVED] wrong number of arguments invalid or property assignment error
    By uduyt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2013, 07:40 PM
  6. Compile Error - Wrong number of arguments
    By freebird_wr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2013, 09:34 AM
  7. wrong number of arguments invalid or property assignment error
    By uduyt in forum Access Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2012, 08:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1