Incremented alphanumeric code for multiple entries

JTGF

New Member
Joined
Aug 3, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I'm no excel pro so forgive me in advance for the lack of proper lingo. I'll try my best to explain everything correctly.

My goals is to create an interactive excel that will allow me to register multiple entrance and exits of material from my warehouse. This is just the first part, but I can't seem to find a solution to this problem out there.

So here we go:

Column B will be selected directly from a drop down list (This part was easy and its done)
Column C will pick the column B line (2 code letter from a set of 9 different codes) and generate a batch ID with "00n" or just "n" (see table bellow with example)

My issue is in generating column C output, I understand the logic, just can't make it happen in excel language:

I should be something like (ex.:Line 2):

1 - look in all C column for a number that starts with "B2" followed by n numbers - GF + 00n or n
2- from all the entries that start with "B2" give me the last entrie
3- return the next number in that alphanumeric code
4 - If nothing is found then write "B2" + 001 or 1


ABC
1Date (EU)Material CodeBatch ID
2
04/07/2020​
GFGF001
3
05/07/2020​
TDTD001
4
06/07/2020​
JLJL001
5
07/07/2020​
DMDM001
6
08/07/2020​
PFPF001
7
09/07/2020​
TQTQ001
8
10/07/2020​
PLPL001
9
11/07/2020​
PSPS001
10
12/07/2020​
PDPD001
11
03/08/2020​
GFGF002
12
03/08/2020​
GFGF003
13
03/08/2020​
GFGF004
14
03/08/2020​
DMDM002
15
03/08/2020​
DMDM003


Does the logic makes sense? Or is there anything here I'm missing?

Thank you in advance for your help, and hope you're all have a nice day.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi & welcome to MrExcel.
How about
+Fluff New.xlsm
ABC
1Date (EU)Material CodeBatch ID
207/04/2020GFGF001
307/05/2020TDTD001
407/06/2020JLJL001
507/07/2020DMDM001
607/08/2020PFPF001
707/09/2020TQTQ001
807/10/2020PLPL001
907/11/2020PSPS001
1007/12/2020PDPD001
1108/03/2020GFGF002
1208/03/2020GFGF003
1308/03/2020GFGF004
1408/03/2020DMDM002
1508/03/2020DMDM003
Main
Cell Formulas
RangeFormula
C2:C15C2=B2&TEXT(COUNTIFS(C$1:C1,B2&"*")+1,"000")
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
Hi @Fluff,

Recently I have made some modifications to the table above trying to use drop down tables and was asked to move it to google sheet. But I'm having an issue with the table.

The dropdowns work fine but when it come to the formula it works for the first line, But when I add new lines it goes off.


Sample description (manual input)Sample type (drop down)Sample ID (ProcV from sheet 2)Sample ID number (formula)How it looks in Googlesheets
bananas INDbananasBABA001BA002
apples URGcarrotsCACA001CA001
oranges BRZbananasBABA002BA002
Carrots USbananasBABA003
Apples USapplesAPAP001
CARROTS FRbananasBA=C7&TEXT(COUNTIFS(D$1:D7,C7&"*")+1,"000")

The sample ID changes automatically as soon as you add the second row information. The idea was for people to add info to the table and the Sample ID to be generated automatically and in sequence.

Can you let me know what might be the issue and how I can fix it?

Thank you for your help
 
Upvote 0
I don't know anything about Sheets, so you would be better off starting a new thread in the General Discussion & Other Applications section & clearly state it's for Sheets.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,588
Members
449,039
Latest member
Arbind kumar

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