Auto pick up next number

springran

Board Regular
Joined
Mar 18, 2014
Messages
56
Office Version
  1. 365
Platform
  1. Windows
Issue the next number

I have set up data validation in column A ( only two on the list A&B).
1710382504831.png


I have the below table in 2nd tab ( as data sources)

1710382542184.png


Output in 1st tab in column B
I want a formula to search in 2nd tab ( Number 1 & Number 2 ), if column A( Team) select A I want to return reference number start with A. The formular is always look for the next number to issue it out.

1710382637112.png


Thank you
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Maybe:

Book2
AB
1TeamReference number
2AA95-0001
3BB50-0002
4BB50-0003
5BB50-0004
6AA95-0005
7
Sheet1
Cell Formulas
RangeFormula
B2:B6B2=IF(A2="","",INDEX(Sheet2!$B$2:$C$8,ROWS(B$2:B2),MATCH(A2,{"A","B"},0)))
Cells with Data Validation
CellAllowCriteria
A2:A7ListA,B


My first stab was actually to return the first unused value in the each column, but it didn't match your expected results. If that's of interest, try:

Excel Formula:
=IF(A2="","",INDEX(Sheet2!$B$2:$C$8,COUNTIF(A$2:A2,A2),MATCH(A2,{"A","B"},0)))
 
Upvote 0
Maybe:

Book2
AB
1TeamReference number
2AA95-0001
3BB50-0002
4BB50-0003
5BB50-0004
6AA95-0005
7
Sheet1
Cell Formulas
RangeFormula
B2:B6B2=IF(A2="","",INDEX(Sheet2!$B$2:$C$8,ROWS(B$2:B2),MATCH(A2,{"A","B"},0)))
Cells with Data Validation
CellAllowCriteria
A2:A7ListA,B


My first stab was actually to return the first unused value in the each column, but it didn't match your expected results. If that's of interest, try:

Excel Formula:
=IF(A2="","",INDEX(Sheet2!$B$2:$C$8,COUNTIF(A$2:A2,A2),MATCH(A2,{"A","B"},0)))

Thank you Eric
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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