These are my values:
Service_order PENDING_DAYS SERVICE_TYPE ASC code INOUTWTY Part_code1 Part_code2 Part_code3 Part_code4 Part_code5
4182864919 18 CI 3440690 LP GH82-11218A GH96-09406A GH81-13594A GH02-11552A GH02-11553A
4182868153 18 CI 4285812 LP GH97-17670B
4182929636 17 CI 4276987 LP GH97-17260C GH02-10203A
4182953067 16 CI 3440690 LP GH97-17940C
4182954688 16 CI 6195657 LP GH82-10555A GH97-17852A GH81-13071A
4182955036 16 PS 6195657 LP GH97-17940C
I'm trying to write code to show the row values five times for each part.
This is the formula that I'm using:
=INDEX(A:I;(ROW(1:1)-1)/5+1;IF(COLUMN(A:A)=1;1;MOD(ROW(1:1)-1;5)+1))
and the result that it gave me is like this:
Service_order PENDING_DAYS SERVICE_TYPE ASC code INOUTWTY Part_code
4182864919 18 CI 3440690 LP GH82-11218A
4182864919 CI 3440690 LP GH82-11218A GH96-09406A
4182864919 3440690 LP GH82-11218A GH96-09406A GH81-13594A
4182864919 LP GH82-11218A GH96-09406A GH81-13594A GH02-11552A
4182864919 GH82-11218A GH96-09406A GH81-13594A GH02-11552A GH02-11553A
4182868153 18 CI 4285812 LP GH97-17670B
4182868153 CI 4285812 LP GH97-17670B 0
4182868153 4285812 LP GH97-17670B 0 0
4182868153 LP GH97-17670B 0 0 0
4182868153 GH97-17670B 0 0 0 0
4182929636 17 CI 4276987 LP GH97-17260C
4182929636 CI 4276987 LP GH97-17260C GH02-10203A
4182929636 4276987 LP GH97-17260C GH02-10203A 0
4182929636 LP GH97-17260C GH02-10203A 0 0
4182929636 GH97-17260C GH02-10203A 0 0 0
which is wrong. As you can see the values start to show again at the second row.
The values that I want to show are (service_order
, Pending_days
, Service_type
, ASC_code
, InOutWty
) and when it reaches the part_code
, the values that I told be the same but the part_code starts to change (part_code1, part_code2, part_code3, part_code4, part_code5).
To show you what I want the result be like, I created this:
Service_order PENDING_DAYS SERVICE_TYPE ASC code INOUTWTY Part_code1
4182864919 18 CI 3440690 LP GH82-11218A
4182864919 18 CI 3440690 LP GH96-09406A
4182864919 18 CI 3440690 LP GH81-13594A
4182864919 18 CI 3440690 LP GH02-11552A
4182864919 18 CI 3440690 LP GH02-11553A
4182868153 18 CI 4285812 LP GH97-17670B
4182868153 18 CI 4285812 LP 0
4182868153 18 CI 4285812 LP 0
4182868153 18 CI 4285812 LP 0
4182868153 18 CI 4285812 LP 0
4182929636 17 CI 4276987 LP GH97-17260C
4182929636 17 CI 4276987 LP GH02-10203A
4182929636 17 CI 4276987 LP 0
4182929636 17 CI 4276987 LP 0
4182929636 17 CI 4276987 LP 0
Where am I going wrong?