column A: has invoice numbers but they have duplicates too so invoice numbers 12345, 12345, 123455 etc

then they have debit credit figures etc

what formula can i use to see which invoice number has the contra

i want to put this in column b

so client A invoice number is 12345 100

but another client 13456 -100

if i do a basic formula it will tell me that the 100 matches with -100 but they are two different clients i want it to based on the invoice number as opposed to only numbers