Formula help needed to create a unique ID

Dmat

Board Regular
Joined
Mar 2, 2009
Messages
58
Office Version
  1. 365
Platform
  1. Windows
Hi all. I'm having trouble figuring out what formula would work best to create my unique tagging.

If the GL Acct starts with a 4 then I want to tag all of the Documents # associated it with Yes. I'm able to write an if statement to tag the GL Acct with a 4 but can't figure out how to tag the Document #s that are the same.

Thanks in advance. Any help would be appreciated.

1727267789217.png
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
When asking this type of question it helps to paste in your actual data instead of an image, because many people won't want to type all of that in for testing. We also can't see your column letters or row numbers, or whether this is a structured table or just a range, and whether your values are numeric or text (they are left-justified so that suggests text).

If this is a range starting in A1 and the GL Acct values are text, put this in A2 and copy down.
Excel Formula:
=IF(COUNTIFS(A:A,A2,B:B,"4*")>0,"Yes","No")
If any of those assumptions are wrong, please provide more detail and the actual data.
 
Upvote 0
Apologies. I've copied and pasted a portion of the file. The countif formula above didn't work, as I also tried =left(GL Acct,1) to isolate the 4xxxxx accounts.

DocumentGL AcctAmountUnique Tagging
0100613611110130137.56No
0100613611220111(31.95)No
0100613611225301(12.51)No
0100613611260110(93.10)No
010061409926011093.10Yes
0100614099406900(93.10)Yes
0100617011110130137.56No
0100617011220111(31.95)No
0100617011225301(12.51)No
0100617011260110(93.10)No
010061749826011093.10Yes
0100617498406900(93.10)Yes
 
Upvote 0
Is the data in the second column numeric or text? As I mentioned, normally when you see data left-justified it's text, but you can format numeric to the left also.

What version of Excel are you using? It helps to put that in your user profile because I don't want to give a solution for MS 365 that won't work if you have 2019.
 
Upvote 0
If GL account numbers are numeric, and always 6 digits, you can use this:

$scratch.xlsm
ABCDE
1DocumentGL AcctAmountUnique TaggingUnique Tagging
20100613611110130137.56NoNo
30100613611220111-31.95NoNo
40100613611225301-12.51NoNo
50100613611260110-93.1NoNo
6010061409926011093.1YesYes
70100614099406900-93.1YesYes
80100617011110130137.56NoNo
90100617011220111-31.95NoNo
100100617011225301-12.51NoNo
110100617011260110-93.1NoNo
12010061749826011093.1YesYes
130100617498406900-93.1YesYes
tagging
Cell Formulas
RangeFormula
E2:E13E2=IF(COUNTIFS(A:A,A2,B:B,">=400000",B:B,"<500000")>0,"Yes","No")
 
Upvote 0
I'm working on MS 365 and all the numbers on the table are text.
 
Upvote 0
In that case my original COUNTIFS formula works. Double check how you entered it. This version uses text in the first two columns.

$scratch.xlsm
ABCDE
1DocumentGL AcctAmountUnique TaggingUnique Tagging
20100613611110130137.56NoNo
30100613611220111-31.95NoNo
40100613611225301-12.51NoNo
50100613611260110-93.1NoNo
6010061409926011093.1YesYes
70100614099406900-93.1YesYes
80100617011110130137.56NoNo
90100617011220111-31.95NoNo
100100617011225301-12.51NoNo
110100617011260110-93.1NoNo
12010061749826011093.1YesYes
130100617498406900-93.1YesYes
tagging (2)
Cell Formulas
RangeFormula
E2:E13E2=IF(COUNTIFS(A:A,A2,B:B,"4*")>0,"Yes","No")
 
Upvote 0
Solution
Thank you 6StringJazzer. The last formula worked with Text values. I really appreciate your help and it will save me so much time.

Out of curiosity, what does the * do in formula?
 
Upvote 0
It's a wildcard indicator that means "match any number of characters". So "4*" means "match any cell that starts with 4 followed by any characters."
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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