• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

With identify card banner

When entering the first six credit card numbers in column A, identify the credit card flag in column B equal to the values recorded in the other spreadsheet
 
In cell A14 of the Flags Identification sheet you have 38, and next to it you want Hipercard.
When I look at column B of the List of Flags sheet you have 38.6 in row 12 and Hipercard next to it… fine, but you also have 38 in cell B6 of the List of Flags sheet which might suggest you want Diners instead?
How are we supposed to treat the decimal/period/full stop in column B of the List of Flags sheet?

I can do this but it's far from straightforward.
74538
 
p45cal
Goodnight!

I made a correction in the list the most complicated and identify the link.
I thought it was easy, but and very complex.
It can be like this the link can be if it is not in the list of others and the link
 

Attachments

  • Identify card banner SPP1.xlsx
    12.1 KB · Views: 6
How are we supposed to treat the decimal/period/full stop in column B of the List of Flags sheet?
I think what has happened is that when you have only 2 entries in a cell like:
41,2345
Excel is treating it in your country as if the comma is a decimal point so it is one number (not two). When I open it in the UK, that number appears as 41.2345.
Anyway, I think I've taken care of it.

In the attached I've made your List of Flags into a proper Excel Table, called Table1:
74553

You can drag the bottom right corner of the table to fit your data if necessary.
Do not change the headers.

A Power Query query splits that table into another table at cell D3 of the same sheet:
74555

It's called Table1_2. It is sorted with the longest Identifier numbers at the top. This is important because you want to find the longest matches first and I've used VLOOKUP which only returns the first match it comes across. If you change the data in Table1 you will need to refresh the Table1_2 table by right-clicking in it and choosing Refresh.

On the Flags Identification sheet I have a formula in column E:
=TEXTJOIN("¬",TRUE,IFERROR(VLOOKUP(LEFT(A2,SEQUENCE(1,LEN(A2),LEN(A2),-1)),Table1_2,2,FALSE),""))
which is where the magic happens;
It takes the value in column A, let's say it is 509074 and it looks for the entire value in Table1_2 and returns the Flag, it then looks for 50907, and returns that too, then looks for 5090, then 509 etc. right down to 1 character returning the Flag each time if it's found. It concatentates all the finds with a '¬' character, so you might get for example:
Elo¬Aura¬Mastercard
which you can see in column E (I later hide this column).
In column F I have the formula:
=LEFT(E2,IFERROR(FIND("¬",E2)-1,999))
which takes only the portion of the string in column E before the first '¬' character (the longest match).

That's it.
 

Attachments

  • Chandoo46280Identify card banner SPP.xlsx
    22.8 KB · Views: 1
Put Elo, Discover, Hipercard on top of the List of Flags

C2
=INDEX('List of Flags'!$A$4:$A$12,MATCH(1,MMULT(--ISNUMBER(1/(FIND(TEXT(TRIM(MID(SUBSTITUTE(SUBSTITUTE('List of Flags'!$B$4:$B$23,".",","),",",REPT(" ",200)),COLUMN($A$1:$Z$1)*200-199,200)),"0;;; "),A2)=1)),ROW(A$1:A$26)^0),))

Confirm with Ctrl+Shift+Enter
 

Attachments

  • Identify card banner SPP1.xlsx
    15 KB · Views: 7
p45cal
Good Morning!

Excel Wizard
Good Morning!

Thank you very much for the help and time available to both.
It was what I needed.
I thought I wouldn't be able to, but you got CONGRATULATIONS.
 
Back
Top