View Single Post
  #14   Report Post  
Domenic
 
Posts: n/a
Default

Assumptions:

1) Each row in the source table (Sheet1) contains unique values.

2) Each row in the source table contains values in ascending order.

Formula:

B19, copied down and across to J19:

=IF(ISNUMBER(MATCH(B$1,Sheet1!$B19:$H19,0)),IF(MAT CH(B$1,Sheet1!$B19:$H19
,0)<7,IF(INDEX(Sheet1!$B19:$H19,MATCH(B$1,Sheet1!$ B19:$H19,0)+1)=B$1+1,B$
1&"-"&B$1+1,""),""),"")

Hope this helps!

In article ,
"Sam via OfficeKB.com" wrote:

Hi Domenic,

Thank you very much for sample file. Your interpretation of what I said is
perfect and the file does what I requested. However, as usual, I did not
fully understand what I actually wanted to see visually on the new
worksheet - Sheet2.

I still require the consecutive values to be returned to Sheet2 by using
the input values on Row 1 of Sheet2 but I need all consecutive values
returned by individual pairs and not by individual numbers. Using the
current formula I would get 82-83-84-85-86-87-88. There are instances where
a Row may contain all consecutive values as below, and what I actually wish
to see is all instances for example of 82-83, 83-84, 84-85, 85-86, 86-87
and 87-88. I'm not sure whether having two columns for each input value
would help.

Is there a way to achieve the above?

Sheet1!B19:H19 contains...
82 83 84 85 86 87 88

Sheet2!B1:K1 contains..
80 81 82 83 84 85 86 87 88 89


Thanks
Sam