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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to compair a cell in row to a cell 5 rows down

Status
Not open for further replies.

Tbirdbully

Technical User
Jul 14, 2006
21
US
I am using CR XI

I am tryign to compair in excel row 1 with the rows below until it reaches no subcode (a,b,c,d)

I have a SWCODE field that has 4 or 5 char in it.
0400
0400a
0400b
0401
0402
0402a



if Length({Sheet1_.SW Dir Code}) = 4 and Next({@length}) then next({Sheet1_.SW Dir Code}) +" " + next({Sheet1_.Product Name})

where @length = ({Sheet1_.SW Dir Code}) = 5
this is because crystal dosn't like length() after next() it expects a field.

the problem with this is it will output the code and product for the next row but if there is more than one additional product it dosnt check below the "next()" row.

is there any next+1() command

i can't find anything online... any help please?
thanks in advance
 
I suggest that you post requirements and stop trying to perform architecture until you're more familiar with the product.

I think that I assisted you with something the other day, and it would be best were you to post example data, and then the expected output.

You can store a value to a variable and use it until you want it reset, but we need an example of what you have and what you need, I don't want to continue guessing.

-k
 
sorry synapsevampire about not being clear

thank u for your patience



Each row of my excel sheet is assigned to a code (0400) or a subcode (0400a). This field is {Sheet1_.SW Dir Code}

0400 Main Product
0400a Additional
0400b Additional
0401 Main Product

the crystal output I have now is this:


-----------------------
0400 Main Product Name


Additional Products:
0400A Product Name

----------------------------

what I need is this:
------------------------------

0400 Main Product Name

Additional Products:
0400A Product Name
0400B Product Name

-------------------------------
where 0400B is a code in the cell below 0400A.



to get the 0400A I used a formula called @additional2 and I placed it under Additional Products


@additional2 =
if Length({Sheet1_.SW Dir Code}) = 4 and Next({@length}) then next({Sheet1_.SW Dir Code}) +" " + next({Sheet1_.Product Name})




My problem is how to keep detecting each row below to see if there is an a,b,c, ect. When it does detect this character, to place that SW Dir Code and product name with the main product page.



Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top