Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default Express 'Joined up' IF's Q

How could I express the following as a Text string

I have 3 Names in A1:A3 (Jim; Bob; Mike); in B1:B3 is a value of
either 1 or 0 (1;0;1). I wish to construct an opening statement
depending if the values in B1:B3 are 1, so for example if B1=1;B2=0
and B3=1 my opening statement would be:

Dear Jim / Mike

if B1=0;B2=0 and B3=1 my opening statement would be:

Dear Mike

if B1=1;B2=1 and B3=1 my opening statement would be:

Dear Jim / Bob / Mike

if B1=0;B2=0 and B3=0 my opening statement would be:

<blank

I have 5 names in total so haven't put all the permutations above,
perhaps there is not an easy way to do this
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Express 'Joined up' IF's Q

=IF(B1+B2+B3,"Dear "&IF(B1,A1,"")&IF(B1*(B2+B3)," /
","")&IF(B2,A2,"")&IF(B2*B3," / ","")&IF(B3,A3,""),"")
--
David Biddulph

"Sean" wrote in message
...
How could I express the following as a Text string

I have 3 Names in A1:A3 (Jim; Bob; Mike); in B1:B3 is a value of
either 1 or 0 (1;0;1). I wish to construct an opening statement
depending if the values in B1:B3 are 1, so for example if B1=1;B2=0
and B3=1 my opening statement would be:

Dear Jim / Mike

if B1=0;B2=0 and B3=1 my opening statement would be:

Dear Mike

if B1=1;B2=1 and B3=1 my opening statement would be:

Dear Jim / Bob / Mike

if B1=0;B2=0 and B3=0 my opening statement would be:

<blank

I have 5 names in total so haven't put all the permutations above,
perhaps there is not an easy way to do this



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default Express 'Joined up' IF's Q

Thanks David, can't seem to get to work

Is this part complete =IF(B1+B2+B3,"Dear "&.....

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Express 'Joined up' IF's Q

The formula I gave works for me.
That formula was
=IF(B1+B2+B3,"Dear "&IF(B1,A1,"")&IF(B1*(B2+B3)," /
","")&IF(B2,A2,"")&IF(B2*B3," / ","")&IF(B3,A3,""),"")
but you may need to be careful if the newsgroup has split the formula at a
line wrap.
If it splits the lines at the " / " stage, there is a space, a slant, and
another space, between the quotes.
--
David Biddulph

"Sean" wrote in message
...
Thanks David, can't seem to get to work

Is this part complete =IF(B1+B2+B3,"Dear "&.....



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Express 'Joined up' IF's Q

I should, of course, have asked what you mean by "can't seem to get to
work".
What error message did you get? If no error message, what result did you
get for what input, and what result did you expect?
--
David Biddulph

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
The formula I gave works for me.
That formula was
=IF(B1+B2+B3,"Dear "&IF(B1,A1,"")&IF(B1*(B2+B3)," /
","")&IF(B2,A2,"")&IF(B2*B3," / ","")&IF(B3,A3,""),"")
but you may need to be careful if the newsgroup has split the formula at a
line wrap.
If it splits the lines at the " / " stage, there is a space, a slant, and
another space, between the quotes.
--
David Biddulph

"Sean" wrote in message
...
Thanks David, can't seem to get to work

Is this part complete =IF(B1+B2+B3,"Dear "&.....







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Express 'Joined up' IF's Q

=IF(SUM(B1:B3),"Dear ","")&IF(B1,"Jim"&IF(SUM(B1:B3)1," /
",""),"")&IF(B2,"Bob"&IF(SUM(B2:B3)1," / ",""),"")&IF(B3,"Mike","")


"Sean" wrote:

How could I express the following as a Text string

I have 3 Names in A1:A3 (Jim; Bob; Mike); in B1:B3 is a value of
either 1 or 0 (1;0;1). I wish to construct an opening statement
depending if the values in B1:B3 are 1, so for example if B1=1;B2=0
and B3=1 my opening statement would be:

Dear Jim / Mike

if B1=0;B2=0 and B3=1 my opening statement would be:

Dear Mike

if B1=1;B2=1 and B3=1 my opening statement would be:

Dear Jim / Bob / Mike

if B1=0;B2=0 and B3=0 my opening statement would be:

<blank

I have 5 names in total so haven't put all the permutations above,
perhaps there is not an easy way to do this

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Express 'Joined up' IF's Q

This works for five names in A1:A5 and 1s or 0s in B1:B5:

=IF(SUM(B1:B5),"Dear ","")&IF(B1,A1&IF(SUM(B2:B5)," /
",""),"")&IF(B2,A2&IF(SUM(B3:B5)," /
",""),"")&IF(B3,A3&IF(SUM(B4:B5)," / ",""),"")&IF(B4,A4&IF(B5," /
",""),"")&IF(B5,A5,"")

Hope this helps.

Pete

On Feb 13, 9:07*pm, Sean wrote:
How could I express the following as a Text string

I have 3 Names in A1:A3 (Jim; Bob; Mike); in B1:B3 is a value of
either 1 or 0 (1;0;1). I wish to construct an opening statement
depending if the values in B1:B3 are 1, so for example if B1=1;B2=0
and B3=1 my opening statement would be:

Dear Jim / Mike

if B1=0;B2=0 and B3=1 my opening statement would be:

Dear Mike

if B1=1;B2=1 and B3=1 my opening statement would be:

Dear Jim / Bob / Mike

if B1=0;B2=0 and B3=0 my opening statement would be:

<blank

I have 5 names in total so haven't put all the permutations above,
perhaps there is not an easy way to do this


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default Express 'Joined up' IF's Q

Thanks David, I had a #value returned, but spotted where I went wrong

Thanks for the other posts too

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
Data Points Joined by Spiral !! monir Charts and Charting in Excel 0 July 21st 07 10:16 PM
Can 3810 and 3819 and 3806 be joined into one cell pano Excel Worksheet Functions 3 February 7th 07 02:45 AM
Can I lock 2 columns together so that the 2 cells in a row are joined? Bernard New Users to Excel 3 August 19th 06 04:36 PM
Joined Combo Boxes Squeaky Excel Discussion (Misc queries) 0 May 2nd 06 03:20 PM
Need to unhide 2 columns that I joined together - Help! Divertada Excel Discussion (Misc queries) 1 December 4th 04 07:13 PM


All times are GMT +1. The time now is 07:39 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"