Excel : sorting issue with SIREN and SIRET
Elcaprio
-
Elcaprio -
Elcaprio -
Hello,
I have a table of 5000 SIRET entries and 5000 SIREN entries. The SIREN are the same as the SIRET, I need to reconcile the two to delete the SIREN (I have data that is on the SIREN rows that need to appear on the corresponding SIRET rows; otherwise, I would simply delete the SIREN).
So I’m stuck because copying line by line 5000 SIREN to paste at the corresponding SIRET is tedious!!!
For example:
I have the SIRET 50040020030010 and the corresponding SIREN: 500400200, and the goal is to have the SIRET on one line and the SIREN on the line below.
Thank you for your responses. I'm quite stuck
Configuration: Windows XP / Internet Explorer 8.0
I have a table of 5000 SIRET entries and 5000 SIREN entries. The SIREN are the same as the SIRET, I need to reconcile the two to delete the SIREN (I have data that is on the SIREN rows that need to appear on the corresponding SIRET rows; otherwise, I would simply delete the SIREN).
So I’m stuck because copying line by line 5000 SIREN to paste at the corresponding SIRET is tedious!!!
For example:
I have the SIRET 50040020030010 and the corresponding SIREN: 500400200, and the goal is to have the SIRET on one line and the SIREN on the line below.
Thank you for your responses. I'm quite stuck
Configuration: Windows XP / Internet Explorer 8.0
12 answers
Hello
First solution: add zeros behind the SIREN to have labels that can sort both lists together
the formula =TEXT($A$4,"00000")
set the cell to standard format, then group your lists and sort
second solution
extract the first 9 characters in a column with the formula =LEFT(B5,9)
and group your lists and look for duplicates, the formula to search for duplicates
=IF(COUNTIF($C$4:$C$9,C4)>1,1,0)
in my example, the SIREN is in column C
First solution: add zeros behind the SIREN to have labels that can sort both lists together
the formula =TEXT($A$4,"00000")
set the cell to standard format, then group your lists and sort
second solution
extract the first 9 characters in a column with the formula =LEFT(B5,9)
and group your lists and look for duplicates, the formula to search for duplicates
=IF(COUNTIF($C$4:$C$9,C4)>1,1,0)
in my example, the SIREN is in column C
Well, as the request evolves, could you "whip up" an example file for us with names, SIREN, SIRET, and other fake data, just like it is currently in your file, but in the correct columns AND the expected results? You can send it to us using cjoint.com...
--
Best regards,
Franck P
--
Best regards,
Franck P
I'm sorry, I may not have been very clear in my request.
I have a client file from the company that gives me the amount of insurance granted and I need to update it with the information provided yesterday by the insurance.
This gives me this: http://cjoint.com/?BFCkpcP4v9I
For the insurance file, I only included the columns that I need; there is a lot of other information that I don't use.
Another point: once the update is done, I do not keep the insurance information.
I have a client file from the company that gives me the amount of insurance granted and I need to update it with the information provided yesterday by the insurance.
This gives me this: http://cjoint.com/?BFCkpcP4v9I
For the insurance file, I only included the columns that I need; there is a lot of other information that I don't use.
Another point: once the update is done, I do not keep the insurance information.
In your test file, all the SIRET numbers form a "block," with no empty cells between each number. Is that the case with your file? Or are there empty cells here and there?
--
Best regards,
Franck P
--
Best regards,
Franck P
I have 3700 entries out of 4900 with a SIRET or SIREN; indeed, I have entries where only the SIREN is displayed.
Thank you for your responses and your patience.
Thank you for your responses and your patience.
Thank you for your responses and your patience There is no problem. The thing is that with a macro, you absolutely need to know the position of each element in your file.
So let me summarize:
in your sheet named: AddressClient France (without space between Address and Client, but with a space between Client and France)
you have a "database" from A1 to Sx composed, in the first 5000 rows of your client base with SIRET number (14 digits), then in the next 5000 rows your data with: in column A the same client references from A2 to A5000 and in column O the SIREN (9 digits)
You want to obtain, in the same sheet (which I will call result) the complete list of your data with two contiguous rows per client, one containing the SIRET and one containing the SIREN
for example:
A2: 411001 O2: 50010050040000
A3: 411001 A3: 500100500
with of course the preservation of all row data...
Is that correct???
So let me summarize:
in your sheet named: AddressClient France (without space between Address and Client, but with a space between Client and France)
you have a "database" from A1 to Sx composed, in the first 5000 rows of your client base with SIRET number (14 digits), then in the next 5000 rows your data with: in column A the same client references from A2 to A5000 and in column O the SIREN (9 digits)
You want to obtain, in the same sheet (which I will call result) the complete list of your data with two contiguous rows per client, one containing the SIRET and one containing the SIREN
for example:
A2: 411001 O2: 50010050040000
A3: 411001 A3: 500100500
with of course the preservation of all row data...
Is that correct???
That's right, except for a small error: the client reference for the insurance is not the same.
The insurance file contains no header, so it's a bit of a pain to navigate.
As a result, I only retrieve the SIREN and the insurance amount.
My final goal is to have the insurance amount in column S for a given SIRET corresponding to the SIREN.
If the first 9 characters match, then copy "insurance amount" into column S.
The insurance file contains no header, so it's a bit of a pain to navigate.
As a result, I only retrieve the SIREN and the insurance amount.
My final goal is to have the insurance amount in column S for a given SIRET corresponding to the SIREN.
If the first 9 characters match, then copy "insurance amount" into column S.
So, last questions:
1- the first 9 digits of your SIRET are all different, unlike in your example file:
50010050040000
50010050050000
50010050060000
50010050070000
50010050080000
50010050090000
50010050100000
50010050110000
50010050120000
2- you want the numbers transmitted by the insurance, which are between S5001 (approximately) and S10000, to be placed between S2 and S5001 next to the correct SIRET numbers.
OK?
--
Best regards,
Franck P
1- the first 9 digits of your SIRET are all different, unlike in your example file:
50010050040000
50010050050000
50010050060000
50010050070000
50010050080000
50010050090000
50010050100000
50010050110000
50010050120000
2- you want the numbers transmitted by the insurance, which are between S5001 (approximately) and S10000, to be placed between S2 and S5001 next to the correct SIRET numbers.
OK?
--
Best regards,
Franck P
Yes, they are all different. I used the same ones for simplification in the example.
The only column that matters to me is the insurance amount column.
I was talking about placing the insurance line below the company line just to manually enter the insurance amount, but it's true that if it can also be automated, then let's go for it.
I put the SIRENs in the same column as the SIRETs because I thought I could solve my problem through sorting or filters. So if they end up in another column, that's not a problem.
Thinking further, I came up with a formula like:
IF(LEFT(U2,9)=LEFT(O2,9),V2,"")
In column U, there are the SIRENs and in V the amounts. But it doesn't work...
The only column that matters to me is the insurance amount column.
I was talking about placing the insurance line below the company line just to manually enter the insurance amount, but it's true that if it can also be automated, then let's go for it.
I put the SIRENs in the same column as the SIRETs because I thought I could solve my problem through sorting or filters. So if they end up in another column, that's not a problem.
Thinking further, I came up with a formula like:
IF(LEFT(U2,9)=LEFT(O2,9),V2,"")
In column U, there are the SIRENs and in V the amounts. But it doesn't work...
In fact, I dropped the unnecessary macro in this case.
I assume your SIRET numbers are in column O from O2 to O5001, your SIREN numbers, in number format, are in column O from O5005 to O10006, the amounts granted by the insurance are in column S from S5005 to S10006, and you want your results in column S from S2 to S5001.
In S2 enter the formula:
=IF(O2="","",VLOOKUP(VALUE(LEFT(O2,9)),$O$25:$S$34,5,FALSE))
Formula to be "dragged" using the fill method down to S5001...
--
Best regards,
Franck P
I assume your SIRET numbers are in column O from O2 to O5001, your SIREN numbers, in number format, are in column O from O5005 to O10006, the amounts granted by the insurance are in column S from S5005 to S10006, and you want your results in column S from S2 to S5001.
In S2 enter the formula:
=IF(O2="","",VLOOKUP(VALUE(LEFT(O2,9)),$O$25:$S$34,5,FALSE))
Formula to be "dragged" using the fill method down to S5001...
--
Best regards,
Franck P
Thank you for your responses.
Unfortunately, I can't apply your formulas :(
To avoid having to scroll down to line 5005 the next time my internship supervisor uses the file, I have placed the SIREN in column U and the amounts in V, so she will just have to copy/paste the columns and place them respectively in U2 and V2.
So I have this now: http://cjoint.com/?BFCp2mCGpdn
Unfortunately, I can't apply your formulas :(
To avoid having to scroll down to line 5005 the next time my internship supervisor uses the file, I have placed the SIREN in column U and the amounts in V, so she will just have to copy/paste the columns and place them respectively in U2 and V2.
So I have this now: http://cjoint.com/?BFCp2mCGpdn
In T2, enter this formula: =CNUM(LEFT(O2,9))
and in U2, enter this one:
=IF(ISERROR(VLOOKUP(T2,$O$2:$S$34000,5,FALSE)),"",VLOOKUP(T2,$O$2:$S$34000,5,FALSE))
and in U2, enter this one:
=IF(ISERROR(VLOOKUP(T2,$O$2:$S$34000,5,FALSE)),"",VLOOKUP(T2,$O$2:$S$34000,5,FALSE))
Hello
Place this formula in S2
=IF(ISERROR(VLOOKUP(VALUE(T2),$O$25:$S$34,5,FALSE)),"",VLOOKUP(VALUE(T2),$O$25:$S$34,5,FALSE))
and this one in T2
=LEFT($O25,9)
and adjust the range O25:S34 to your range
Then drag it down the entire height
Place this formula in S2
=IF(ISERROR(VLOOKUP(VALUE(T2),$O$25:$S$34,5,FALSE)),"",VLOOKUP(VALUE(T2),$O$25:$S$34,5,FALSE))
and this one in T2
=LEFT($O25,9)
and adjust the range O25:S34 to your range
Then drag it down the entire height
I just realized that I can't change the format. However, I had set a custom format: [>999999999]########_######;Standard
The problem may come from there.
By sorting using the "filter" tool, I see that in my SIRET column (so O), there are variable character strings: most are made up of 14 digits (normal for a SIRET), but I also have some that are 9 digits. I have many that start with 0, in my opinion that's not normal and it must not help.
I think I won't bother you any longer; I will enter it manually :-/
The problem may come from there.
By sorting using the "filter" tool, I see that in my SIRET column (so O), there are variable character strings: most are made up of 14 digits (normal for a SIRET), but I also have some that are 9 digits. I have many that start with 0, in my opinion that's not normal and it must not help.
I think I won't bother you any longer; I will enter it manually :-/
I don't understand anything about macros xD
Are there any empty cells in this column O?
In fact, I have a client list with the SIRET numbers and from a file provided by the insurance, I need to input the insurance amount for each client, but the file identifies the clients by the SIREN numbers.