How to avoid double value

Zachary14

New Member
Joined
May 29, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi guys, i need some help. maybe you guys could help me with some idea or in script with vba. I have two tables. one for borrowing table, the other one for returning table.
How to avoid double value when i try to fill "amount returned", when in the ID's column has some, same ID. Here's the tables for clearer explanation. thank you
takon.JPG
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
What formula are you using now that is returning the "double value"?
Do you simply always want to return 1 when the value is found in the other table, no matter how many times it may appear, and regardless of what is showing in "Amount Borrowed"?
If that is not what you are looking for, please explain in more detail, and walk us through the logic of a specific example from your data sample.
 
Upvote 0
What formula are you using now that is returning the "double value"?
Do you simply always want to return 1 when the value is found in the other table, no matter how many times it may appear, and regardless of what is showing in "Amount Borrowed"?
If that is not what you are looking for, please explain in more detail, and walk us through the logic of a specific example from your data sample.
thanks Mr.Joe, i'm sorry it was take some time to reply this. here's the logic : whenever i fill number in "Amount Returned" column(based on ID, RIGHT table) it will automatically filled in "Amount Returned" column (LEFT table). Example (from the ideal logic : when i fill in HPP39210 with amount returned "1" (i fill it in the RIGHT table), it will automatically filled with "1" in "Amount Returned" column in the LEFT table. But, since there are some similar ID in LEFT table, i want to avoid something like this :

LEFT TABLE RIGHT TABLE
ID AMOUNT BORROWED AMOUNT RETURNED ID AMOUNT RETURNED
HPP39210 4 1 HPP39210 1
HPP39210 1 1

the ideal logic that i hoped is like this :
LEFT TABLE RIGHT TABLE
ID AMOUNT BORROWED AMOUNT RETURNED ID AMOUNT RETURNED
HPP39210 4 1 HPP39210 1
HPP39210 1 0

Thanks Mr. Joe
 
Upvote 0
What formula are you using now that is returning the "double value"?
Do you simply always want to return 1 when the value is found in the other table, no matter how many times it may appear, and regardless of what is showing in "Amount Borrowed"?
If that is not what you are looking for, please explain in more detail, and walk us through the logic of a specific example from your data sample.
thanks Mr.Joe, i'm sorry it was take some time to reply this. here's the logic : whenever i fill number in "Amount Returned" column(based on ID, RIGHT table) it will automatically filled in "Amount Returned" column (LEFT table). Example (from the ideal logic : when i fill in HPP39210 with amount returned "1" (i fill it in the RIGHT table), it will automatically filled with "1" in "Amount Returned" column in the LEFT table. But, since there are some similar ID in LEFT table,
i want to avoid something like this :
WRONG.JPG

the ideal logic that i hoped is like this :
RIGHT.JPG
 
Upvote 0
Since you seem to have duplicate IDs in your left column, how do you know which ID to apply the value to?
What is the logic you want to use for determining that?
Do you just want to use the first one until the Amount Returned matches the Amount Borrowed, then go on to the next one?

Also, for the table on the right, how is it going to be used ongoing?
Let's say that you enter a value for HPP39210 in the amount of 1.
Might you have another entry for this ID later?
If so, will you just enter an additional line in the right table for that, or will you just overwrite the value in Amount Returned for the existing row with this ID?
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,453
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top