Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Formula - Pick the next highest pipe wall thickness 3

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
US
I have a table of pipe data. The data includes the Pipe Size, Outer Diameter, Inner Diameter, and Wall Thickness.

For pipeline related calculations, a minimum wall thickness is calculated for the given service. I need help creating a formula that will pick the next highest wall thickness for a given pipe size.

So for example, let's say my calculation says for a 4" pipe, I need a minimum wall thickness of 0.242".

From the table below, how would I ensure the formula chooses a wall thickness of 0.250?

[tt]Size OD ID WT
1 1.315 0.957 0.179
1 1.315 0.815 0.250
1 1.315 0.599 0.358
2 2.375 1.939 0.218
2 2.375 1.875 0.249
2 2.375 1.813 0.281
4 4.5 4.124 0.188
4 4.5 4.094 0.203
4 4.5 4.062 0.219
4 4.5 4.026 0.237
4 4.5 4.000 0.250
4 4.5 3.938 0.281
6 6.625 6.281 0.172
6 6.625 6.249 0.188
6 6.625 6.219 0.203
6 6.625 6.187 0.219
6 6.625 6.125 0.252
[/tt]

Thanks for your help!

Thanks!!


Matt
 
>two variables on the same line in a Dim statement
Yes, you can do that, but you need to do this:

Code:
Dim wtCol As Integer, pipeCol As Integer

And, many people (call them 'programmers' :)) follow the naming convention where part of the name of the variable - the prefix - is its type. So, 'they' would have:

Code:
Dim [blue]int[/blue]WTCol As [blue]Int[/blue]eger, [blue]int[/blue]PipeCol As [blue]Int[/blue]eger

[pc2]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Excel worksheet has over one milion rows, even if it may be not your case that the table size exceeds limit for integers, it may be safer to declare:
[tt]Dim r As Long Integer[/tt]

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top