A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

nested ifs



 
 
Thread Tools Display Modes
  #1  
Old November 13th, 2009, 06:23 PM posted to microsoft.public.excel.misc
dave glynn
external usenet poster
 
Posts: 5
Default nested ifs

Cell C1 takes is value from any one of three other cells depending on the
value of cell B4. The if statement I should like to writr would go something
like this

if(b4=1,b1&if(b4=2,b2&if(b4=3,b3)))

Is this syntax correct?

Many thanks

Dave
  #2  
Old November 13th, 2009, 06:28 PM posted to microsoft.public.excel.misc
Sean Timmons
external usenet poster
 
Posts: 1,722
Default nested ifs

& is used for concatenation.

=IF(B4=1,B1,if(B4=2,B2,if(B4=3,B3,"")))

But, you can alternately do:

=INDIRECT("B"&B4)

"dave glynn" wrote:

Cell C1 takes is value from any one of three other cells depending on the
value of cell B4. The if statement I should like to writr would go something
like this

if(b4=1,b1&if(b4=2,b2&if(b4=3,b3)))

Is this syntax correct?

Many thanks

Dave

  #3  
Old November 13th, 2009, 06:31 PM posted to microsoft.public.excel.misc
Tom Hutchins
external usenet poster
 
Posts: 722
Default nested ifs

Try this in C1

=IF(B4=1,B1,IF(B4=2,B2,IF(B4=3,B3,"")))

The "" is what is returned if B4 is not 1, 2, or 3.

Hope this helps,

Hutch

"dave glynn" wrote:

Cell C1 takes is value from any one of three other cells depending on the
value of cell B4. The if statement I should like to writr would go something
like this

if(b4=1,b1&if(b4=2,b2&if(b4=3,b3)))

Is this syntax correct?

Many thanks

Dave

  #4  
Old November 13th, 2009, 06:38 PM posted to microsoft.public.excel.misc
Joe User[_2_]
external usenet poster
 
Posts: 757
Default nested ifs

If B4 will contain only 1, 2 or 3, you could use:

=CHOOSE(B4,B1,B2,B3)

As for the IF syntax, I suspect you want:

=IF(B4=1, B1, IF(B4=2, B2, B3))


----- original message -----

"dave glynn" wrote in message
news
Cell C1 takes is value from any one of three other cells depending on the
value of cell B4. The if statement I should like to writr would go
something
like this

if(b4=1,b1&if(b4=2,b2&if(b4=3,b3)))

Is this syntax correct?

Many thanks

Dave


  #5  
Old November 13th, 2009, 07:55 PM posted to microsoft.public.excel.misc
dave glynn
external usenet poster
 
Posts: 5
Default nested ifs

Mny thanks Sean

"Sean Timmons" wrote:

& is used for concatenation.

=IF(B4=1,B1,if(B4=2,B2,if(B4=3,B3,"")))

But, you can alternately do:

=INDIRECT("B"&B4)

"dave glynn" wrote:

Cell C1 takes is value from any one of three other cells depending on the
value of cell B4. The if statement I should like to writr would go something
like this

if(b4=1,b1&if(b4=2,b2&if(b4=3,b3)))

Is this syntax correct?

Many thanks

Dave

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.