Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with algorithm

I have got a sheet that looks like this:

B C

20 77.8
20 77.7
20 77.7
20 77.7
20 77.6
40 77.4
40 77.4
40 77.4
40 77.3
60 77.3
60 77.3
60 77.3
60 77.3
60 77.4
60 77.4
60 77.4
80 77.6
80 77.6
80
80
100
100
100
100
100
100
100
120
120
120
120
120
120
140
140
140
140 78.4
140 78.5
140 78.5
140 78.5
160 78.6
160 78.6
160 78.7
160 78.7
160 78.7
160 78.8
180 78.6
180 78.6
180 78.5
180 78.5
180 78.5
180 78.4
200 78.4
200 78.3
200 78.3
200 78.3
200 78.2
200 78.2

It starts at B1 and goes on to B... What I want is to have the range o
values in column C for all of the same values in column B.
For example, the first range would return C1:C5 (because al
coresponding values in column B are 20). And then C6:C9 for value 40 i
column B etc... But it should only return values that exist. For exapl
value 80 in column B has only 2 coresponding values in column C so onl
the range of those 2 value should be returned

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default help with algorithm

In C1 enter
=IF(ISERR(FIND(" ",B1,1)0),"",VALUE(MID(B1,FIND(" ",B1,1)+1,255)))
and copy down.
HTH

"dreamer " wrote in message
...
I have got a sheet that looks like this:

B C

20 77.8
20 77.7
20 77.7
20 77.7
20 77.6
40 77.4
40 77.4
40 77.4
40 77.3
60 77.3
60 77.3
60 77.3
60 77.3
60 77.4
60 77.4
60 77.4
80 77.6
80 77.6
80
80
100
100
100
100
100
100
100
120
120
120
120
120
120
140
140
140
140 78.4
140 78.5
140 78.5
140 78.5
160 78.6
160 78.6
160 78.7
160 78.7
160 78.7
160 78.8
180 78.6
180 78.6
180 78.5
180 78.5
180 78.5
180 78.4
200 78.4
200 78.3
200 78.3
200 78.3
200 78.2
200 78.2

It starts at B1 and goes on to B... What I want is to have the range of
values in column C for all of the same values in column B.
For example, the first range would return C1:C5 (because all
coresponding values in column B are 20). And then C6:C9 for value 40 in
column B etc... But it should only return values that exist. For exaple
value 80 in column B has only 2 coresponding values in column C so only
the range of those 2 value should be returned.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with algorithm

It doen't work

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default help with algorithm

Post the formula that "doen't work".
Can't do anything for you with just "It doen't work."

"dreamer " wrote in message
...
It doen't work.


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with algorithm

Hehe, sorry syntax error...
Anyway, I just did what you said to do (copy the formula to C1) but I
get a #NAME error. It's maybe because I use a non-English Excel
version.? So I tried this in VB editor

With Range("C1")
..FormulaR1C1 = "=IF(ISERR(FIND(" ",B1,1)0),"",VALUE(MID (B1,FIND("
",B1,1)+1,255)))"

End With

but this gives a copiler error (saying that the first " " is expected
to be end of the instruction) .


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default help with algorithm

With Range("C1")
Formula = "=IF(ISERR(FIND("" "",B1,1)0),"""",VALUE(MID
(B1,FIND("" "",B1,1)+1,255)))"

testing in the immediate window:

? "=IF(ISERR(FIND("" "",B1,1)0),"""",VALUE(MID(B1,FIND(""
"",B1,1)+1,255)))"
=IF(ISERR(FIND(" ",B1,1)0),"",VALUE(MID(B1,FIND(" ",B1,1)+1,255)))

also, since you using A1 notation, you would use formula rather than
formulaR1C1

Sub tester5()
With Range("C1")
.Formula = _
"=IF(ISERR(FIND("" "",B1,1)0),"""",VALUE(MID(B1,FIND("" "",B1,1)+1,255)))"
End With
End Sub

although I doubt that formula is what you want. Your discription of what
you want is not very clear. I assume columns B and C already exist and you
want to get these ranges somewhere else, but as I said, you description is
not very clear.


--
Regards,
Tom Ogilvy

"dreamer " wrote in message
...
Hehe, sorry syntax error...
Anyway, I just did what you said to do (copy the formula to C1) but I
get a #NAME error. It's maybe because I use a non-English Excel
version.? So I tried this in VB editor

With Range("C1")
FormulaR1C1 = "=IF(ISERR(FIND(" ",B1,1)0),"",VALUE(MID (B1,FIND("
",B1,1)+1,255)))"

End With

but this gives a copiler error (saying that the first " " is expected
to be end of the instruction) .


---
Message posted from http://www.ExcelForum.com/



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
searching for my perfect algorithm.... meesh7391 Excel Discussion (Misc queries) 0 January 11th 06 01:55 PM
Curve fitting algorithm ringo Charts and Charting in Excel 4 January 11th 06 11:46 AM
looking for my perfect algorithm meesh7391 Excel Discussion (Misc queries) 0 January 11th 06 12:06 AM
Algorithm Challenge Lowkey Excel Worksheet Functions 4 July 20th 05 06:40 PM
Need help with algorithm RADO[_3_] Excel Programming 1 November 4th 03 12:37 PM


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