ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How can I do this? (https://www.excelbanter.com/excel-worksheet-functions/145873-how-can-i-do.html)

Tmaxx02

How can I do this?
 
I have a sheet with numbers in three columns.
I would like to have a formula or function to
look across the row and tell me if there is a
consecutive number. In other words:

A B C D
3 4 1 34

In column D, I'd like display the results 34 if
there are consecutive numbers.

Thanks in advance.


JE McGimpsey

How can I do this?
 
One way:

D1: =IF(B1=A1+1,A1&B1&IF(C1=B1+1,C1,""),IF(C1=B1+1,B1& C1,""))


In article . com,
Tmaxx02 wrote:

I have a sheet with numbers in three columns.
I would like to have a formula or function to
look across the row and tell me if there is a
consecutive number. In other words:

A B C D
3 4 1 34

In column D, I'd like display the results 34 if
there are consecutive numbers.

Thanks in advance.


Pete_UK

How can I do this?
 
Assuming your numbers are in row 1, try this in D1:

=IF(B1=A1+1,A1&B1,IF(C1=B1+1,B1&C1,""))

Note that this returns a text answer - if you had 10 in one cell and
11 next to it you would get 1011.

Hope this helps.

Pete

On Jun 8, 10:40 pm, Tmaxx02 wrote:
I have a sheet with numbers in three columns.
I would like to have a formula or function to
look across the row and tell me if there is a
consecutive number. In other words:

A B C D
3 4 1 34

In column D, I'd like display the results 34 if
there are consecutive numbers.

Thanks in advance.




Tmaxx02

How can I do this?
 
Both of these work with this exception: if 4 is before the 3, it
returns a blank.
I think that I could probably work this out though. Thanks very much,
I appreciate it.

Terry


T. Valko

How can I do this?
 
This accounts for both ascending and descending values:

A B C D
3 4 1 34
4 3 1 43


=IF(ABS(A1-B1)=1,A1&B1&IF(ABS(B1-C1)=1,C1,""),IF(ABS(B1-C1)=1,B1&C1,""))

Biff

"Tmaxx02" wrote in message
ups.com...
I have a sheet with numbers in three columns.
I would like to have a formula or function to
look across the row and tell me if there is a
consecutive number. In other words:

A B C D
3 4 1 34

In column D, I'd like display the results 34 if
there are consecutive numbers.

Thanks in advance.




Tmaxx02

How can I do this?
 
On Jun 8, 4:36 pm, "T. Valko" wrote:
This accounts for both ascending and descending values:

A B C D
3 4 1 34
4 3 1 43


=IF(ABS(A1-B1)=1,A1&B1&IF(ABS(B1-C1)=1,C1,""),IF(ABS(B1-C1)=1,B1&C1,""))

Biff

"Tmaxx02" wrote in message

ups.com...



I have a sheet with numbers in three columns.

That worked great. It also accounted for more than 2 numbers. Thanks
very much.

Terry




I would like to have a formula or function to
look across the row and tell me if there is a
consecutive number. In other words:


A B C D
3 4 1 34


In column D, I'd like display the results 34 if
there are consecutive numbers.


Thanks in advance.- Hide quoted text -


- Show quoted text -




T. Valko

How can I do this?
 
Note the result if the values are negative:

A B C D
-3 -4 1 -3-4


Biff

"T. Valko" wrote in message
...
This accounts for both ascending and descending values:

A B C D
3 4 1 34
4 3 1 43


=IF(ABS(A1-B1)=1,A1&B1&IF(ABS(B1-C1)=1,C1,""),IF(ABS(B1-C1)=1,B1&C1,""))

Biff

"Tmaxx02" wrote in message
ups.com...
I have a sheet with numbers in three columns.
I would like to have a formula or function to
look across the row and tell me if there is a
consecutive number. In other words:

A B C D
3 4 1 34

In column D, I'd like display the results 34 if
there are consecutive numbers.

Thanks in advance.






T. Valko

How can I do this?
 

"Tmaxx02" wrote in message
oups.com...
On Jun 8, 4:36 pm, "T. Valko" wrote:
This accounts for both ascending and descending values:

A B C D
3 4 1 34
4 3 1 43


=IF(ABS(A1-B1)=1,A1&B1&IF(ABS(B1-C1)=1,C1,""),IF(ABS(B1-C1)=1,B1&C1,""))

Biff

"Tmaxx02" wrote in message

ups.com...



I have a sheet with numbers in three columns.

That worked great. It also accounted for more than 2 numbers. Thanks
very much.

Terry


You're welcome. Thanks for the feedback!

Biff




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

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