Formula to generate ref nr

lizemi

New Member
Joined
Sep 5, 2021
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Hi
I need some help on a formula to generate a reference number.
Basically, I need a formula that looks if there is a value other than 0 in collum A and then creates a reference number in collum A that is 1+ the previous value.
So if there is a value that is not 0 in D3 A3 has to have a reference number like A3 has FEB001
If for example the value in D is 0 like in D5 A should be empty like A5 is
But if Example D5 had a value of not 0 then A5 should be FEB003 and A14 will then be FEB004 and so on
1709705090267.png
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Like this ?

Excel Formula:
=IF(D3=0,"",CONCAT("LMFEB",TEXT(COUNT($D$3:D3),"000")))

1709707126553.png
 
Upvote 0
Upvote 0
try like this

Excel Formula:
=IF(IFERROR(OR(D3=0,D3="-",AND(D3<1,D3>-1)),""),"",CONCAT("LMFEB",TEXT(COUNT($D$3:D3),"000")))
 
Last edited:
Upvote 0
In A3, copied down try
Excel Formula:
=IF(D3=0,"","LMFEB"&TEXT(COUNTIF(D$3:D3,">0"),"000"))
 
Upvote 0

Forum statistics

Threads
1,215,312
Messages
6,124,199
Members
449,147
Latest member
sweetkt327

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