Excel Formula Help

$tephen W.

New Member
Joined
Apr 8, 2011
Messages
2
Hello, I need help with the following excel formula. If a credit cards is 1234...5678 how do I create a formula to say if the first number =1 then call this mastercard or if the first number is 2 call this visa?

Thank
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
The formual still does not sum.. This is what it looks like.

<TABLE style="WIDTH: 385pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=513 border=0><COLGROUP><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width=88><COL style="WIDTH: 319pt; mso-width-source: userset; mso-width-alt: 15542" width=425><TBODY><TR style="HEIGHT: 15pt" height=20><TD id=td_post_2677265 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 66pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=88 height=20>3772...3006</TD><TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 319pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width=425></TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20></TD><TD class=xl65 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">=IF(LEFT(A1,1)="1","Mastercard",IF(LEFT(A1,1)="2","Visa","")

</TD></TR></TBODY></TABLE>
 
Upvote 0
=IF(LEFT(A1,1)="1","Mastercard","Visa") if you only have 2 options, Vogs formula can be trimmed slightly
 
Upvote 0
The formual still does not sum.. This is what it looks like.

<table style="WIDTH: 385pt; BORDER-COLLAPSE: collapse" border="0" cellpadding="0" cellspacing="0" width="513"><colgroup><col style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width="88"><col style="WIDTH: 319pt; mso-width-source: userset; mso-width-alt: 15542" width="425"></colgroup><tbody><tr style="HEIGHT: 15pt" height="20"><td id="td_post_2677265" style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 66pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height="20" width="88">3772...3006</td><td style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 319pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" width="425">
</td></tr><tr style="HEIGHT: 15pt" height="20"><td style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height="20">
</td><td class="xl65" style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">=IF(LEFT(A1,1)="1","Mastercard",IF(LEFT(A1,1)="2","Visa","")

</td></tr></tbody></table>

are you looking to sum say all the mastercards in column? then have something similar for Visa? your original post stated you just wanted to have the word mastercard or visa.....can you clarify
 
Upvote 0
something like this?

Excel Workbook
FGH
2Ref NumberAmountCard Type
3112345681419.00mastercard
42123456792162.00visa
51123456804256.00mastercard
61123456819520.00mastercard
72123456843466.00visa
82123456826442.00visa
91123456831466.00mastercard
101123456847281.00mastercard
112123456789629.00visa
121123456840240.00mastercard
132123456808288.00visa
141123456794527.00mastercard
151123456842602.00mastercard
16112345680295.00mastercard
172123456794211.00visa
182123456820370.00visa
191123456822272.00mastercard
202123456790475.00visa
212123456817476.00visa
221123456850629.00mastercard
232123456831556.00visa
24Mastercard3907
25Visa4075
Array Formula Option


with Vogs formula to designate the card type
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,771
Members
452,941
Latest member
Greayliams

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