apelsunkist
New Member
- Joined
- Dec 12, 2012
- Messages
- 10
i have this kind of data as reference. where the bill could be not-sorted in any order. [TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4045[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]8608[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4046[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]5023[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]5023[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]
i want to get some data from that table and put it into another table as this :
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
which is more neat, sorted, and already separated into each first digit of the bill number. im going to separate the data from the first table into several separated sheet based on the first two digit of the bill number. the first two digit of the bill number define which bill-book it's belong.
i want to fill the data in the G column from the value in the B column, based on the criteria of the A column that meet the exact as in the F column.
so i'm using :
the result is
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]TOTAL[/TD]
[TD]18[/TD]
[/TR]
</tbody>[/TABLE]
the thing is, every bill number (in column A) could only have one value. as it should be. For each bill number, there could only be one transaction. so you could only use one bill number once. if the same bill number shown twice or more in the first table (column A), than it must have be a typo (or worse, a fraud =P).
what i want is, if there is a bill number that shown twice or more in column A, than it would result in N/A or error in column G.
as wise if there is a bill number that is not shown in column A (e.g bill number 5022) it would also resulting in N/A or other error sign.
by looking the N/A or error sign i could know that there is some wrong typo in the data from the first table. and i could know which data i should clarify and corrected.
the sumproduct formula i used, give adding when there is a bill number repeated (bill number 5023), instead of N/A. and also give 0 when there is a bill number that is not written (bill number 5022), instead of N/A.
i have try
yet for the bill number that shown twice (bill number 5023), instead of an N/A, it still fill the column G with the first data of the bill number 5023 (3).
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]TOTAL[/TD]
[TD]N/A[/TD]
[/TR]
</tbody>[/TABLE]
the result that i want is, more or less :
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]TOTAL[/TD]
[TD]N/A[/TD]
[/TR]
</tbody>[/TABLE]
i actually dont understand Pivot Table and Macro at all. so i would rather stick with a formula if i could.
is there a formula to get a result as described above? any kind of help would be great
and what options i could use, to find a numbers that is shown twice or more in the A column? MODE formula could return the data that is most frequently occuring, its true. but only one single reasult. in my data there could be more than one bill number that is typed wrong and might shown more than one time.
if you could help me solve either the two problem (especially the first one), i think i could finally able to delegate the writing job to others with ease at heart. and it does really a weight-lifting
well if there is anyone who could help me, im pretty sure that he/she is in this forum
im using Win-7 and Excel-2007.
regards,
riza rizki
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4045[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]8608[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4046[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]5023[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]5023[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
</tbody>[/TABLE]
i want to get some data from that table and put it into another table as this :
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
which is more neat, sorted, and already separated into each first digit of the bill number. im going to separate the data from the first table into several separated sheet based on the first two digit of the bill number. the first two digit of the bill number define which bill-book it's belong.
i want to fill the data in the G column from the value in the B column, based on the criteria of the A column that meet the exact as in the F column.
so i'm using :
it does fill the G column with the value from the B column.=SUMPRODUCT(($A$2:$A$9=$F2)*($B$2:$B$9))
the result is
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]TOTAL[/TD]
[TD]18[/TD]
[/TR]
</tbody>[/TABLE]
the thing is, every bill number (in column A) could only have one value. as it should be. For each bill number, there could only be one transaction. so you could only use one bill number once. if the same bill number shown twice or more in the first table (column A), than it must have be a typo (or worse, a fraud =P).
what i want is, if there is a bill number that shown twice or more in column A, than it would result in N/A or error in column G.
as wise if there is a bill number that is not shown in column A (e.g bill number 5022) it would also resulting in N/A or other error sign.
by looking the N/A or error sign i could know that there is some wrong typo in the data from the first table. and i could know which data i should clarify and corrected.
the sumproduct formula i used, give adding when there is a bill number repeated (bill number 5023), instead of N/A. and also give 0 when there is a bill number that is not written (bill number 5022), instead of N/A.
i have try
which i dont actually understand how does it works =P. but it does give me N/A in the bill number that is not writted (bill number 5022).=INDEX($B$2:$B$9;MATCH($F2;$A$2:$A$9;0);0)
yet for the bill number that shown twice (bill number 5023), instead of an N/A, it still fill the column G with the first data of the bill number 5023 (3).
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]TOTAL[/TD]
[TD]N/A[/TD]
[/TR]
</tbody>[/TABLE]
the result that i want is, more or less :
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Bill Number[/TD]
[TD]Cloth Value[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5021[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]5022[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5023[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5024[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]5025[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]TOTAL[/TD]
[TD]N/A[/TD]
[/TR]
</tbody>[/TABLE]
i actually dont understand Pivot Table and Macro at all. so i would rather stick with a formula if i could.
is there a formula to get a result as described above? any kind of help would be great
and what options i could use, to find a numbers that is shown twice or more in the A column? MODE formula could return the data that is most frequently occuring, its true. but only one single reasult. in my data there could be more than one bill number that is typed wrong and might shown more than one time.
if you could help me solve either the two problem (especially the first one), i think i could finally able to delegate the writing job to others with ease at heart. and it does really a weight-lifting
well if there is anyone who could help me, im pretty sure that he/she is in this forum
im using Win-7 and Excel-2007.
regards,
riza rizki
Last edited: