Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading portion of an Excel cell

Status
Not open for further replies.

sumncguy

IS-IT--Management
May 22, 2006
118
US
172.19.156.5/24
172.21.198.2/24
10.200.63.114/29

I am a excel rookie.
A spread sheet already exists with the cells given above.

I want to look at the last two digits. Based on there value, populate a different cell with the decimal equivalent.

for instance
if the last two digits in the cell are

24 populate a cell with 255.255.255.0

Thanks
 
=IF(RIGHT(A1,2)="24","255.255.255.0","")

will look for one total. If you only have a few, you can nest IF statements to cover them all.

Another way is to have a table that has 24 in one cell and 255.255.255.0 in an adjacent cell. Complete the table with all combinations and use a formula like:

=VLOOKUP(RIGHT(A1),<table range>,2,0)

You can also add error checking.

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 




hi,

Check out data > Text to columns... Delimited using the SLASH character and do not import the first column.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top