Auto assign number with +1 If meet the condition given

bobby786

Board Regular
Joined
Apr 24, 2014
Messages
87
Office Version
  1. 2016
Platform
  1. Windows
Hi all experts ,

i have workbook in which i need to maintain the orders and producer of the product.

My Goal:
COL C Producer ( if its new product and not enter before in the above COL , then it should auto assign Invoice number in D6,D7,D8 as "ORD#1" , if its 2nd time then "ORD#2" , 3rd time "ORD#3" )
For Example :
Product1 = Ord#1
Product2= Ord#1
Prodcut1= Ord#2
Product2=Ord#2
Product3=Ord#1

purpose is to track that particular order with invoice , as same product ordered in different times will carry different details in the other area of the sheet so i need to assign a unique number to be able to identify them in later stages . If i explain it poorly please do let me know i will try my best again.

PS: English is not my native language , but i use it everyday :)


BOOK_2020 - 2 - Copy.xlsm
CDEF
6JF SonicORD#1500A800
7JF SonicORD#21000A800
8LongzhenORD#15000S30
9LongzhenORD#24000S30
10JF SonicORD#31000A800
11JF SonicORD#41000A800
12Guiyang CBORD#1500A800
13Longzhen1500A800
CENTRAL
Cells with Data Validation
CellAllowCriteria
C6:F13Any value
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
How about
+Fluff New.xlsm
CDEF
6JF SonicORD#1500A800
7JF SonicORD#21000A800
8LongzhenORD#15000S30
9LongzhenORD#24000S30
10JF SonicORD#31000A800
11JF SonicORD#41000A800
12Guiyang CBORD#1500A800
13LongzhenORD#3500A800
Main
Cell Formulas
RangeFormula
D6:D13D6="ORD#"&COUNTIFS(C$6:C6,C6)
 
Upvote 0
How about
+Fluff New.xlsm
CDEF
6JF SonicORD#1500A800
7JF SonicORD#21000A800
8LongzhenORD#15000S30
9LongzhenORD#24000S30
10JF SonicORD#31000A800
11JF SonicORD#41000A800
12Guiyang CBORD#1500A800
13LongzhenORD#3500A800
Main
Cell Formulas
RangeFormula
D6:D13D6="ORD#"&COUNTIFS(C$6:C6,C6)
@Fluff
Great Mate , insted of C6 i applied on F6 to make it product based count.

Thank you again.

Regards
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
@Fluff and all others expert out there.

Its been a long for this post , i was not able to work on it , due to my health conditions.
I required a help from you. The above provided formula works fine if there is no manually define ORD# in COL D , but since we have some product with history of product therefore i need to assign its current ORD# , which i try to do it manually as it can be seen in COL D8 , but when i try to make new instance of the same product instead it should give me ORD#8 it just give me ORD#2 ,

Is it possible to re-arrange the formula in a way that it should check the ORD#7 of that particular product and add+1 from that number.
if i explain it not correctly please forgive me , i am not native english guy.

Thanks in advance.


BOOK_2020.V3_2020-10-03.xlsm
CDEFG
6ArrowORD#110000Solo X52019-12-04
7ArrowORD#210,000Solo X52019-12-04
8Amaway ORD#7Solo X92021-03-30
9Amaway ORD#2Solo X9
CENTRAL
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
+Fluff 1.xlsm
CDEFG
6ArrowORD#110000Solo X543803
7ArrowORD#210000Solo X543803
8Amaway ORD#7Solo X944285
9Amaway ORD#8Solo X9
10ORD#9Solo X9
Results
Cell Formulas
RangeFormula
D6:D7,D9:D10D6=IF(F6="","",IF(COUNTIFS(F$6:F6,F6)=1,"ORD#1","ORD#"&MAX(IF(F3:F5=F6,REPLACE(D3:D5,1,4,"")+0))+1))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
+Fluff 1.xlsm
CDEFG
6ArrowORD#110000Solo X543803
7ArrowORD#210000Solo X543803
8Amaway ORD#7Solo X944285
9Amaway ORD#8Solo X9
10ORD#9Solo X9
Results
Cell Formulas
RangeFormula
D6:D7,D9:D10D6=IF(F6="","",IF(COUNTIFS(F$6:F6,F6)=1,"ORD#1","ORD#"&MAX(IF(F3:F5=F6,REPLACE(D3:D5,1,4,"")+0))+1))
Press CTRL+SHIFT+ENTER to enter array formulas.

@Fluff You are Super Formula Hero . Its working fine. Thank you man.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hi All,

its been long time,I am using the above formula provided by Great @ Fluff with no problems.But recently I am getting a strange error.For example cell D122 showing ORD#4 which is correct.But when Double click it and press Enter it will show as #Value error. As can be seen in D133.
I try to figure it out myself,but after failing I am seeking the help here again.


BOOK_2020.V3_2021-04-11 - Clean.Code_Master_Updated_Untouched.xlsm
CD
121Fuxi TechnologyORD#3
122Fuxi TechnologyORD#4
123Huwanda#VALUE!
CENTRAL
Cell Formulas
RangeFormula
D121:D122D121=IF(F121="","",IF(COUNTIFS(F$6:F121,F121)=1,"ORD#1","ORD#"&MAX(IF(F$6:F120=F121,REPLACE(D$6:D120,1,4,"")+0))+1))
D123D123=IF(F123="","",IF(COUNTIFS(F$6:F123,F123)=1,"ORD#1","ORD#"&MAX(IF(F$6:F122=F123,REPLACE(D$6:D122,1,4,"")+0))+1))
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D123Expression=$DT123textNO
D122Expression=$DT122textNO
D121Expression=$DT121textNO
AG18:AY18,AC18:AE18,AC21:AE21,AC23:AE36,AC40:AE51,AC53:AE60,AC15:AE16,AG15:AY16,AG21:AY21,AG43:AT51,B6:AY6,AF6:AF72,AC17:AY17,AC52:AT52,AC37:AY39,AC22:AY22,AC19:AY20,AG23:AY36,Y7:AA73,AC61:AT73,AS6:AS73,C75,E75:W75,AG53:AT60,AU43:AY73,AG40:AY42,C76:W76Expression=$DT6textNO
Cells with Data Validation
CellAllowCriteria
C121:D123Any value
 
Upvote 0
You are getting the error in D123 as that formula is no longer array entered. You need to go back into the cell & confirm the formula with Ctrl Shift Enter.
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,222
Members
453,024
Latest member
Wingit77

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