+ Reply to Thread
Results 1 to 8 of 8

chose the right data!

Hybrid View

  1. #1
    Registered User
    Join Date
    11-04-2006
    Posts
    18

    chose the right data!

    hi

    I am tryin to automate something

    where there is a label and it choses the data depending on that data, BUT if that data is consisted of more than 1 data, it needs to follow up with the data necessary.

    example: COL A "fruits" COL B needs to say "apples" COL C "Pears

    another example: COL A "Car Type" COL B "Brand" COL C should say "4 door" Col D "Toyota" Col E "Mazda" Col F "Benz"

    attached is a small factor of what is needed, the numbers take priority over letters, so if the data label is CARs the data output would be CARs 1 vs over CARs A

    Thanks all!
    Attached Files Attached Files

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi ianternet,

    Sorry for the late entry, but try this

    in cell G2 =IF(ISERROR(VLOOKUP(C2,IPs!$A$2:$G$16,2,FALSE)),"",VLOOKUP(C2,IPs!$A$2:$G$16,2,FALSE))

    in cell H2 =IF(ISERROR(VLOOKUP(C2,IPs!$A$2:$G$16,3,FALSE)),"",VLOOKUP(C2,IPs!$A$2:$G$16,3,FALSE))

    in cell I2 =IF(ISERROR(VLOOKUP(C2,IPs!$A$2:$G$16,4,FALSE)),"",VLOOKUP(C2,IPs!$A$2:$G$16,4,FALSE))

    in cell J2 =IF(ISERROR(VLOOKUP(C2,IPs!$A$2:$G$16,5,FALSE)),"",VLOOKUP(C2,IPs!$A$2:$G$16,5,FALSE))

    copy these down the rows, you should get what you need
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    11-04-2006
    Posts
    18
    thanks for the reply I have tried this and it somewhat works, because the first statement would be true until it reaches an cell that states something else.

    for example:

    9332 Afghanistan GBX Arbinet Telus


    it will provide me the IPs of GBX for the first 2 columns, then it needs to give me a single IP for Arbinet

    Column A and B should be GBX IPs and then column C should be Arbinet col D should be Telus, since GBX has 2 IPs it needs to provide an A then a B IP and it does work until it reaches the second column but needs to input an IP in a third column output

    thanks - I am still tryin to work with this

    I have tried Dsums and data function but it has not helped either, or maybe I am not using proper conjunctions with other funtions.

  4. #4
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Hi ianternet,

    I looked at this when you first posted it. Could not figure out what you wanted and gave up.

    Do I understand correctly that sometimes you want a single value returned, sometimes you want 2 values returned, sometimes 3, et cetera?

    Chippy's suggestion would do that my returning "" sometimes. But, that is not exactly what you want either, right? Because what gets returned depends on what was entered and how many columns in the data table match, et cetera. Is that right?

    I believe that the logic is going to be too complex to put into cell formulas. In which case, you can probably get to where you want to go by using VBA and the appropriate IF and/or Select Case statements.

    I could help with that, but ... honestly ... I just do not understand the logic from the examples given in the posting ("fruits" and "Car Type") vs. what I saw when I opened the workbook. It all left me very confused.

  5. #5
    Registered User
    Join Date
    11-04-2006
    Posts
    18

    excel update file

    I have attached an update sheet maybe that might help

    and a better example based on the IP tab, I will try the formula again on this new update
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-04-2006
    Posts
    18
    I have tried the above code and it gave me the following:

    COUNTRY CODE COUNTRY NAME LCR 2nd LCR 3rd LCR 4th LCR A Route B Route C Route D Route
    93 Afghanistan TeleGlobe Arbinet Telus GBX IP a 0 0 0
    9330 Afghanistan TeleGlobe Arbinet Telus GBX IP a 0 0 0
    9331 Afghanistan TeleGlobe Arbinet Telus GBX IP a 0 0 0
    9332 Afghanistan GBX Arbinet Telus TeleGlobe IP a IP b 0 0
    9333 Afghanistan GBX Arbinet Telus TeleGlobe IP a IP b 0 0
    9334 Afghanistan GBX Arbinet Telus TeleGlobe IP a IP b 0 0
    9335 Afghanistan TeleGlobe Arbinet Telus GBX IP a 0 0 0
    9336 Afghanistan TeleGlobe Arbinet Telus GBX IP a 0 0 0
    9337 Afghanistan Wiltel GBX Telus GBX IP a IP b 0 0
    9338 Afghanistan Wiltel GBX Telus GBX IP a IP b 0 0
    9339 Afghanistan Wiltel GBX Telus GBX IP a IP b 0 0


    Where the 0 are there should be IP a

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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