ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   multiple "if" arguments (https://www.excelbanter.com/excel-discussion-misc-queries/52291-multiple-if-arguments.html)

Bob

multiple "if" arguments
 
I have a workbook with week1,week2,week3,week4 and period
i am trying to input 1 in a3 week 1 for period a3 to show period 1 or input
5 in a3 week 1 for period a3 to show period 2 and so on
is there a formula for period a3 to show what period i am working on just by
inputing 1 or 5 or 9 so forth in week 1 a3?
any help or ideas will be welcome

pinmaster

multiple "if" arguments
 

Hi,
Try using a VLOOKUP formula instead. Start by creating a table
somewhere in your workbook with your input numbers in column 1 and the
corresponding period number in column 2, then:
=VLOOKUP(A3,your table,2,0)

HTH
JG


--
pinmaster
------------------------------------------------------------------------
pinmaster's Profile: http://www.excelforum.com/member.php...fo&userid=6261
View this thread: http://www.excelforum.com/showthread...hreadid=479359


bmccabe

Too many arguments
 
I am having a difficult time getting this if formula to work. All of the
individual pieces work fine and three pieces work as a three-argument
statement. When I add the last argument ...
IF(B28="neither",E2+e3+e4+E5+B19+B22+k49 ... I get this error: "You've
entered too many arguments for this function."

Here is the whole formula:

=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B28="neither",E2+E3+E4+E5 +B19+B22+k49))))


Dave Peterson

Too many arguments
 
Did you mean this:

IF(B28="no",E2+E3+E4,+E5+K49
or
IF(B28="no",E2+E3+E4+E5+K49



bmccabe wrote:

I am having a difficult time getting this if formula to work. All of the
individual pieces work fine and three pieces work as a three-argument
statement. When I add the last argument ...
IF(B28="neither",E2+e3+e4+E5+B19+B22+k49 ... I get this error: "You've
entered too many arguments for this function."

Here is the whole formula:

=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B28="neither",E2+E3+E4+E5 +B19+B22+k49))))


--

Dave Peterson

Peo Sjoblom

Too many arguments
 
You have an extra comma here
B28="no",E2+E3+E4,+E5+K49
use
B28="no",E2+E3+E4+E5+K49

You would probably want something like

=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4+E5+K49,IF(B2
8="neither",E2+E3+E4+E5+B19+B22+K49,""))))



--

Regards,

Peo Sjoblom

"bmccabe" wrote in message
...
I am having a difficult time getting this if formula to work. All of the
individual pieces work fine and three pieces work as a three-argument
statement. When I add the last argument ...
IF(B28="neither",E2+e3+e4+E5+B19+B22+k49 ... I get this error: "You've
entered too many arguments for this function."

Here is the whole formula:


=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B
28="neither",E2+E3+E4+E5+B19+B22+k49))))




wjohnson

multiple "if" arguments
 

Why not have the 3 different cells reference the "groups" of cells you
are adding for the different conditions. Then in your formula - make a
reference to the individual cells.
Your formula:
=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28=
"no",E2+E3+E4+E5+K49,IF(B28="neither",E2+E3+E4+E5+ B19+B22+K49,""))))
Example
Cell A1 contains the following SUM (E2+E3+E5+K49)
Cell B1 contains the following SUM (E2+E3+E4+E5+K49)
Cell C1 contains the following SUM (E2+E3+E4+E5+B19+B22+K49)
Then change the formula as follows:
=IF(B28="cash",0,IF(B28="yes",A1(B28=
"no",B1,IF(B28="neither",C1,""))))
Then I usually highlight the cells with a color to indicate an
"reference" to other cells, so I don't manually enter any text or
numbers into them.


--
wjohnson
------------------------------------------------------------------------
wjohnson's Profile: http://www.excelforum.com/member.php...o&userid=29640
View this thread: http://www.excelforum.com/showthread...hreadid=479359


Kris

Too many arguments
 
bmccabe wrote:

Here is the whole formula:

=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B28="neither",E2+E3+E4+E5 +B19+B22+k49))))

^^^^^^^^^^^^
,+E5+K49 ?????


PCLIVE

Too many arguments
 
You should be able to simplify your formula as follows.

=IF(B28="cash",0,IF(B28="yes",SUM(E2,E3,E5,K49),IF (B28="no",SUM(E2:E5,K49),IF(B28="neither",SUM(E2:E 5,B19,B22,K49)))))

HTH,
Paul

"Kris" wrote in message
...
bmccabe wrote:

Here is the whole formula:
=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B28="neither",E2+E3+E4+E5 +B19+B22+k49))))

^^^^^^^^^^^^
,+E5+K49 ?????




PCLIVE

Too many arguments
 
In your previous formula, it looks like you had a stray comma.

=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4 ,
+E5+K49,IF(B28="neither",E2+E3+E4+E5+B19+B22+k49)) ))

"PCLIVE" wrote in message
...
You should be able to simplify your formula as follows.

=IF(B28="cash",0,IF(B28="yes",SUM(E2,E3,E5,K49),IF (B28="no",SUM(E2:E5,K49),IF(B28="neither",SUM(E2:E 5,B19,B22,K49)))))

HTH,
Paul

"Kris" wrote in message
...
bmccabe wrote:

Here is the whole formula:
=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B28="neither",E2+E3+E4+E5 +B19+B22+k49))))

^^^^^^^^^^^^
,+E5+K49 ?????






Sandy Mann

Too many arguments
 
Assuming that that others have been saying about the additional comma,
because you are referencing the same set of cell in all three options the
formula can be shortened to:

=IF(B28="cash",0,SUM(E2,E3,E5,K49)+IF(B28="no",E4, IF(B28="neither",SUM(E4,B19,B22),0)))

Note however that it will return SUM(E2,E3,E5,K49) for "yes" or any other
entry in B28 except "no" or "neither" If this is not acceptable then add
another IF before the SUM(E2,E3,E5,K49)

--
HTH

Sandy

with @tiscali.co.uk


"bmccabe" wrote in message
...
I am having a difficult time getting this if formula to work. All of the
individual pieces work fine and three pieces work as a three-argument
statement. When I add the last argument ...
IF(B28="neither",E2+e3+e4+E5+B19+B22+k49 ... I get this error: "You've
entered too many arguments for this function."

Here is the whole formula:

=IF(B28="cash",0,IF(B28="yes",E2+E3+E5+K49,IF(B28= "no",E2+E3+E4,+E5+K49,IF(B28="neither",E2+E3+E4+E5 +B19+B22+k49))))





All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com