tlc53
Active Member
- Joined
- Jul 26, 2018
- Messages
- 399
Hi,
I am doing my head in with this formula and was wondering if someone could help me please??
[TABLE="width: 500"]
<tbody>[TR]
[TD]Description[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]Rent for Store - April 2015[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Rent for Apartment - April 2015[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Office Room Hire - April 2015[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Client payment on account[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - bananas[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - oranges[/TD]
[TD]123/003[/TD]
[/TR]
[TR]
[TD]Something else - grapes[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - pears[/TD]
[TD]123/003[/TD]
[/TR]
[TR]
[TD]Something else - apples[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - kiwifruit[/TD]
[TD]123/008[/TD]
[/TR]
</tbody>[/TABLE]
I have a table similar to the above with 10 rows. I then have a table with 10 rows below. If 10 different codes were entered, all 10 rows would be populated. However, in example above, I would want it to return the following;
123/001
123/003
123/008
"Blank"
"Blank"
"Blank"
"Blank"
"Blank"
"Blank"
"Blank"
So it does not repeat any of the codes.
The first formula is straight forward as it just looks at the first cell and returns the value if populated. The second formula on gets a little trickier. My current formula returns 123/003123/008 which is 123/003 and 123/008. I want it to only return 123/003.
=IF(B3=B2,"",B3)&IF(OR(B4=B3,OR(B4=B2)),"",B4)&IF(OR(B5=B4,OR(B5=B3,OR(B5=B2))),"",B5)&IF(OR(B6=B5,OR(B6
=B4,OR(B6=B3,OR(B6=B2)))),"",B6)&IF(OR(B7=B6,OR(B7=B5,OR(B7=B4,OR(B7=B3,OR(B7=B2))))),"",B7)&IF(OR(B8=
B7,OR(B8=B6,OR(B8=B5,OR(B8=B4,OR(B8=B3,OR(B8=B2)))))),"",B8)&IF(OR(B9=B8,OR(B9=B7,OR(B9=B6,OR(B9=B5,
OR(B9=B4,OR(B9=B3,OR(B9=B2))))))),"",B9)&IF(OR(B10=B9,OR(B10=B8,OR(B10=B7,OR(B10=B6,OR(B10=B5,OR(B10
=B4,OR(B10=B3,OR(B10=B2)))))))),"",B10)&IF(OR(B11=B10,OR(B11=B9,OR(B11=B8,OR(B11=B7,OR(B11=B6,OR(B11=
B5,OR(B11=B4,OR(B11=B3,OR(B11=B2))))))))),"",B11)
Once I have this working, I was then going to get adjacent cells to sum up the values depending on the code.
Thank you for your time!
I am doing my head in with this formula and was wondering if someone could help me please??
[TABLE="width: 500"]
<tbody>[TR]
[TD]Description[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD]Rent for Store - April 2015[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Rent for Apartment - April 2015[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Office Room Hire - April 2015[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Client payment on account[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - bananas[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - oranges[/TD]
[TD]123/003[/TD]
[/TR]
[TR]
[TD]Something else - grapes[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - pears[/TD]
[TD]123/003[/TD]
[/TR]
[TR]
[TD]Something else - apples[/TD]
[TD]123/001[/TD]
[/TR]
[TR]
[TD]Something else - kiwifruit[/TD]
[TD]123/008[/TD]
[/TR]
</tbody>[/TABLE]
I have a table similar to the above with 10 rows. I then have a table with 10 rows below. If 10 different codes were entered, all 10 rows would be populated. However, in example above, I would want it to return the following;
123/001
123/003
123/008
"Blank"
"Blank"
"Blank"
"Blank"
"Blank"
"Blank"
"Blank"
So it does not repeat any of the codes.
The first formula is straight forward as it just looks at the first cell and returns the value if populated. The second formula on gets a little trickier. My current formula returns 123/003123/008 which is 123/003 and 123/008. I want it to only return 123/003.
=IF(B3=B2,"",B3)&IF(OR(B4=B3,OR(B4=B2)),"",B4)&IF(OR(B5=B4,OR(B5=B3,OR(B5=B2))),"",B5)&IF(OR(B6=B5,OR(B6
=B4,OR(B6=B3,OR(B6=B2)))),"",B6)&IF(OR(B7=B6,OR(B7=B5,OR(B7=B4,OR(B7=B3,OR(B7=B2))))),"",B7)&IF(OR(B8=
B7,OR(B8=B6,OR(B8=B5,OR(B8=B4,OR(B8=B3,OR(B8=B2)))))),"",B8)&IF(OR(B9=B8,OR(B9=B7,OR(B9=B6,OR(B9=B5,
OR(B9=B4,OR(B9=B3,OR(B9=B2))))))),"",B9)&IF(OR(B10=B9,OR(B10=B8,OR(B10=B7,OR(B10=B6,OR(B10=B5,OR(B10
=B4,OR(B10=B3,OR(B10=B2)))))))),"",B10)&IF(OR(B11=B10,OR(B11=B9,OR(B11=B8,OR(B11=B7,OR(B11=B6,OR(B11=
B5,OR(B11=B4,OR(B11=B3,OR(B11=B2))))))))),"",B11)
Once I have this working, I was then going to get adjacent cells to sum up the values depending on the code.
Thank you for your time!