Trying to find if a number exists in a column and +1 it

NORRILLOUS

New Member
Joined
Apr 10, 2014
Messages
36
Office Version
  1. 365
Platform
  1. Windows
I have been trying to get a formula to work.

the logic I am trying to achieve is something like "If my serial number is found in my range then add "+1" to the end digit of the string."

First I figured out how to tell if the result of a formula already exists in a column. The Formula below returns True.

VBA Code:
=ISNUMBER(MATCH(A8&"-"&D8&"."&LEFT(E8,1)&".0",$F$2:$F$1000,0))

The problem is I can have multiple serial numbers show as the same but I want them to increase as more is added on the same date. So I added the above into an if statement and added +1 but I am stuck here. It will Show the serial number with .0 to start and the second will be .1 but the third is null.

VBA Code:
=IF(ISNUMBER(MATCH(A8&"-"&D8&"."&LEFT(E8,1)&".0",$F$2:$F$1000,0)),A8&"-"&D8&"."&LEFT(E8,1)&"."&"0"+1,)

I appreciate any help and Thank you in advance.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Could you please demonstrate a few examples of your serial numbers: the initial one you are searching for, and the one you want to get. Please cover corner cases: e.g. what happens if the last digit is 9.

J.Ty.
 
Upvote 0
Yes Below are a few values of the serial numbers. Every serial number when created I have set to end in 0. and I would like to count up incrementally from there if more than one serial number is assigned on that date and shift.
1S-43893.2.0
2P-43895.3.0
5P-43895.1.0

For example:

If there were 3 action items assigned in the same area and the resulting serial number was 5P-43895.1.0 I would need the new resulting serial number found in my list to increase the final digit by 1.
5P-43895.1.0
5P-43895.1.1
5P-43895.1.2

Now if the resulting serial number goes beyond 5P-43895.1.9 it is fine for it to be 5P-43895.1.10, 5P-43895.1.11, 5P-43895.1.12 etc...
 
Upvote 0
I have made the following. Please test it.

Book1
ABCDEF
15P-43895.1.3
25P-43895.1.0
35P-43895.1.1
45P-43895.1.2
5
6
7
85P438951
Sheet1
Cell Formulas
RangeFormula
A1A1=A8&"-"&D8&"."&LEFT(E8,1)&"."&(MAX(VALUE(RIGHT(F2:F4,LEN(F2:F4)-LEN(A8&"-"&D8&".")-2)))+1)
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0

Forum statistics

Threads
1,215,583
Messages
6,125,664
Members
449,247
Latest member
wingedshoes

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