+ Reply to Thread
Results 1 to 4 of 4

Credit card type based on card number

  1. #1
    Registered User
    Join Date
    04-15-2011
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    9

    Credit card type based on card number

    Hello,
    At work, we use a spreadsheet containing credit card numbers. Based on the card number, we will then enter MC/Visa into another cell if the card is either one of those, or enter AMX if the card number is an American Express number.

    Visa cards begin with the number 4. Mastercard begins with the number 5. American Express cards begin with 3.

    Unfortunately, we have to enter the entire card number into the cell, can't just enter the first digit.

    Is there a way to have cell a3 return "AMX", if a number beginning with 3 is entered into cell A1?
    Conversely, can cell A3 return "Visa/MC" if the number beginning with 4 OR 5 is entered into cell A1?

    Thanks.
    Excel 2010

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Credit card type based on card number

    hi wlsnopps, welcome to the forum. try:
    =IF(LEFT(A1)="3","AMX",IF(OR(LEFT(A1)={"4","5"}),"Visa/MC",""))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Credit card type based on card number

    Another option...

    =IF(A1<>"",LOOKUP(LEFT(A1),{"3","4","5"},{"AMX","VISA/MC","VISA/MC"}),"")
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    04-15-2011
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Credit card type based on card number

    Thanks benishiryo. That is exactly what I needed. And a very big thanks for answering so quickly.
    I'm high-fiving you right now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1