Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default 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 -



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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


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



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

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

About Us

"It's about Microsoft Excel"