#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
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
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested IF with a possible SUM? Princessl210 Excel Discussion (Misc queries) 1 April 8th 08 07:56 AM
nested if based on nested if in seperate sheet. how? scouserabbit Excel Worksheet Functions 5 March 2nd 07 04:03 PM
Nested Ifs Amy Excel Worksheet Functions 3 October 9th 06 01:54 AM
Nested IF Ed Ferrero Excel Discussion (Misc queries) 4 November 27th 05 05:31 PM
Nested If with And TheLeafs Excel Worksheet Functions 2 August 24th 05 05:24 PM


All times are GMT +1. The time now is 09:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"