Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default IF Function and Concatenation

I have three columns that I am trying to Concatenate. I only need to combine
two columns at a time, but I want to be able to Concatenate say Column C and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column C and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default IF Function and Concatenation

"Lance Hebert" wrote:
I want to be able to Concatenate say Column C and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than
Column C and Column B would be Conceatenated.


Is this what you want:

=if(OR(D1={4,5,6}), C1 & A1, if(OR(D1={11,12,13}), C1 & B1, ""))

If D1 can contain __only__ one of the values 4, 5, 6, 11, 12 or 13, that can
be simplified:

=if(OR(D1={4,5,6}), C1 & A1, C1 & B1)

or

=C1 & if(OR(D1={4,5,6}, A1, B1)

Also, if D1 is text, not numeric, you need to write OR(D1={"4","5","6"}) and
OR(D1={"11","12","13"}).


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

"Lance Hebert" wrote in message
...
I have three columns that I am trying to Concatenate. I only need to
combine
two columns at a time, but I want to be able to Concatenate say Column C
and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column C
and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default IF Function and Concatenation

Hi,
if(or(D1=4,D1=5,D1=6),A1&B1,B1&C1)

"Lance Hebert" wrote:

I have three columns that I am trying to Concatenate. I only need to combine
two columns at a time, but I want to be able to Concatenate say Column C and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column C and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF Function and Concatenation

=IF(OR(D1={4,5,6}),A1&B1,IF(OR(D1={11,12,13}),C1&B 1,""))
--
David Biddulph


"Lance Hebert" wrote in message
...
I have three columns that I am trying to Concatenate. I only need to
combine
two columns at a time, but I want to be able to Concatenate say Column C
and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column C
and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF Function and Concatenation

Sorry, you said columns C and A, so:

=IF(OR(D1={4,5,6}),C1&A1,IF(OR(D1={11,12,13}),C1&B 1,""))
or perhaps
=C1&IF(OR(D1={4,5,6}),A1,IF(OR(D1={11,12,13}),B1," "))
depending on what you want if D1 isn't one of those specified values.
--
David Biddulph

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
=IF(OR(D1={4,5,6}),A1&B1,IF(OR(D1={11,12,13}),C1&B 1,""))
--
David Biddulph


"Lance Hebert" wrote in message
...
I have three columns that I am trying to Concatenate. I only need to
combine
two columns at a time, but I want to be able to Concatenate say Column C
and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column C
and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default IF Function and Concatenation

This is what I have used:
=IF(OR(L2={37,38}),M2&K2,L2&K2)

but if L2 = 37 or 38, the result (which should be M2&K2) is actually the
L2&K2 result. What would I have done wrong?


"Joe User" wrote:

"Lance Hebert" wrote:
I want to be able to Concatenate say Column C and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than
Column C and Column B would be Conceatenated.


Is this what you want:

=if(OR(D1={4,5,6}), C1 & A1, if(OR(D1={11,12,13}), C1 & B1, ""))

If D1 can contain __only__ one of the values 4, 5, 6, 11, 12 or 13, that can
be simplified:

=if(OR(D1={4,5,6}), C1 & A1, C1 & B1)

or

=C1 & if(OR(D1={4,5,6}, A1, B1)

Also, if D1 is text, not numeric, you need to write OR(D1={"4","5","6"}) and
OR(D1={"11","12","13"}).


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

"Lance Hebert" wrote in message
...
I have three columns that I am trying to Concatenate. I only need to
combine
two columns at a time, but I want to be able to Concatenate say Column C
and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column C
and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.


.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default IF Function and Concatenation

L2 probably contains text numbers, that's why
Switch it all to be text number comparisons,
Try: =IF(OR(L2&""={"37","38"}),M2&K2,L2&K2)
The above should now work fine regardless whether L2 contains real or text
nums. Success? hit the YES below
--
Max
Singapore
---
"Lance Hebert" wrote:
This is what I have used:
=IF(OR(L2={37,38}),M2&K2,L2&K2)

but if L2 = 37 or 38, the result (which should be M2&K2) is actually the
L2&K2 result. What would I have done wrong?


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default IF Function and Concatenation

"Lance Hebert" wrote:
This is what I have used:
=IF(OR(L2={37,38}),M2&K2,L2&K2)
but if L2 = 37 or 38, the result (which should be M2&K2) is actually the
L2&K2 result. What would I have done wrong?




"Lance Hebert" wrote in message
...
This is what I have used:
=IF(OR(L2={37,38}),M2&K2,L2&K2)

but if L2 = 37 or 38, the result (which should be M2&K2) is actually the
L2&K2 result. What would I have done wrong?


"Joe User" wrote:

"Lance Hebert" wrote:
I want to be able to Concatenate say Column C and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than
Column C and Column B would be Conceatenated.


Is this what you want:

=if(OR(D1={4,5,6}), C1 & A1, if(OR(D1={11,12,13}), C1 & B1, ""))

If D1 can contain __only__ one of the values 4, 5, 6, 11, 12 or 13, that
can
be simplified:

=if(OR(D1={4,5,6}), C1 & A1, C1 & B1)

or

=C1 & if(OR(D1={4,5,6}, A1, B1)

Also, if D1 is text, not numeric, you need to write OR(D1={"4","5","6"})
and
OR(D1={"11","12","13"}).


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

"Lance Hebert" wrote in message
...
I have three columns that I am trying to Concatenate. I only need to
combine
two columns at a time, but I want to be able to Concatenate say Column
C
and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column
C
and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.


.


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default IF Function and Concatenation

"Lance Hebert" wrote:
This is what I have used:
=IF(OR(L2={37,38}),M2&K2,L2&K2)
but if L2 = 37 or 38, the result (which should be M2&K2) is actually
the L2&K2 result. What would I have done wrong?


If L2 is text, you should write OR(L2={"37","38"}), as I mentioned before.

But perhaps L2 is numeric and only __appears__ to be 37 or 38 due to
formatting. In other words, the actual numeric value might be something
other than exactly 37 or 38.

One way to see this is to go through steps to format the cell as Scientific
with 14 decimal places (click on Format Cells Number tab). Even if you
do not understand the format (x.xx...xxE-xx), this will usually demonstrate
whether or not the cell value is exactly an integer (x.00...00E+xx).

The following might solve your problem:

=IF(OR(ROUND(L2,0)={37,38}), M2&K2, L2&K2)

But even that will not work if the problem is, for example: L2 contains
time, and you formatted the cell to display only hours or minutes.


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

"Lance Hebert" wrote in message
...
This is what I have used:
=IF(OR(L2={37,38}),M2&K2,L2&K2)

but if L2 = 37 or 38, the result (which should be M2&K2) is actually the
L2&K2 result. What would I have done wrong?


"Joe User" wrote:

"Lance Hebert" wrote:
I want to be able to Concatenate say Column C and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than
Column C and Column B would be Conceatenated.


Is this what you want:

=if(OR(D1={4,5,6}), C1 & A1, if(OR(D1={11,12,13}), C1 & B1, ""))

If D1 can contain __only__ one of the values 4, 5, 6, 11, 12 or 13, that
can
be simplified:

=if(OR(D1={4,5,6}), C1 & A1, C1 & B1)

or

=C1 & if(OR(D1={4,5,6}, A1, B1)

Also, if D1 is text, not numeric, you need to write OR(D1={"4","5","6"})
and
OR(D1={"11","12","13"}).


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

"Lance Hebert" wrote in message
...
I have three columns that I am trying to Concatenate. I only need to
combine
two columns at a time, but I want to be able to Concatenate say Column
C
and
Column A if Column D=4, 5 or 6 or if Column D=11, 12 or 13 than Column
C
and
Column B would be Conceatenated.

Is this possible? I know how to put in the IF function, but can the IF
function have a number of possibilites in it?

Thanks so much for all of your help.


.


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
What's Wrong: Concatenation and Function Walter Excel Worksheet Functions 2 May 21st 09 09:53 PM
Concatenation MichaelS Excel Discussion (Misc queries) 8 September 11th 08 07:54 AM
Concatenation ATHER Excel Worksheet Functions 2 May 19th 08 11:27 PM
Concatenation Ken Excel Discussion (Misc queries) 1 April 12th 06 11:26 AM
Concatenation using IF AND - Possible? Col Excel Worksheet Functions 3 April 30th 05 01:22 AM


All times are GMT +1. The time now is 06:38 AM.

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"