exctract with two categories..

zaidan

New Member
Joined
Sep 18, 2008
Messages
34
I want to extract data by taking the last two digit, with two condition :

1.10 to 50, refers to 1000 to 5000 :
10 => 1000
20 => 2000
30 => 3000
40 => 4000
50 => 5000

2. for above 5000 has different code :
56 => 6000
57 => 7000
58 => 8000
59 => 9000
60 => 10000
61 => 11000
62 => 12000

example :
data : (in column A)
32410
32420
32430
32440
32450
32456
32457
32458
32459
32460
32461
32462

result i want : (in column B)
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000

thanks for any help... :)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
If you create a table of your values 10-62 in one column and the values 1000 to 12000 in the second column then this formula will work in column B (where $F$6:$G$17 equals where you have made your table of values).

=VLOOKUP(VALUE(RIGHT(A6,2)),$F$6:$G$17,2,0)
 
Upvote 0
I'd make a VLOOKUP table and then your mappings like so:
Sheet1

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 8pt; FONT-FAMILY: Arial,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"><COL style="WIDTH: 56px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="TEXT-ALIGN: right">10</TD><TD style="TEXT-ALIGN: right">1000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32410</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">1000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">20</TD><TD style="TEXT-ALIGN: right">2000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32420</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">2000</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">30</TD><TD style="TEXT-ALIGN: right">3000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32430</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">3000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">40</TD><TD style="TEXT-ALIGN: right">4000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32440</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">4000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">50</TD><TD style="TEXT-ALIGN: right">5000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32450</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">5000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">56</TD><TD style="TEXT-ALIGN: right">6000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32456</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">6000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: right">57</TD><TD style="TEXT-ALIGN: right">7000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32457</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">7000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">8</TD><TD style="TEXT-ALIGN: right">58</TD><TD style="TEXT-ALIGN: right">8000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32458</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">8000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">9</TD><TD style="TEXT-ALIGN: right">59</TD><TD style="TEXT-ALIGN: right">9000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32459</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">9000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">10</TD><TD style="TEXT-ALIGN: right">60</TD><TD style="TEXT-ALIGN: right">10000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32460</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">10000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">11</TD><TD style="TEXT-ALIGN: right">61</TD><TD style="TEXT-ALIGN: right">11000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32461</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">11000</TD></TR><TR style="HEIGHT: 19px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">12</TD><TD style="TEXT-ALIGN: right">62</TD><TD style="TEXT-ALIGN: right">12000</TD><TD> </TD><TD style="TEXT-ALIGN: right">32462</TD><TD style="BACKGROUND-COLOR: #ccffff; TEXT-ALIGN: right">12000</TD></TR></TBODY></TABLE>


<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>E1</TD><TD>=VLOOKUP(RIGHT(D1,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E2</TD><TD>=VLOOKUP(RIGHT(D2,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E3</TD><TD>=VLOOKUP(RIGHT(D3,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E4</TD><TD>=VLOOKUP(RIGHT(D4,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E5</TD><TD>=VLOOKUP(RIGHT(D5,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E6</TD><TD>=VLOOKUP(RIGHT(D6,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E7</TD><TD>=VLOOKUP(RIGHT(D7,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E8</TD><TD>=VLOOKUP(RIGHT(D8,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E9</TD><TD>=VLOOKUP(RIGHT(D9,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E10</TD><TD>=VLOOKUP(RIGHT(D10,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E11</TD><TD>=VLOOKUP(RIGHT(D11,2)+0,$A$1:$B$12,2,0)</TD></TR><TR><TD>E12</TD><TD>=VLOOKUP(RIGHT(D12,2)+0,$A$1:$B$12,2,0)</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

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