+ Reply to Thread
Results 1 to 8 of 8

Getting a Given Number from Either of Two Columns

  1. #1
    Registered User
    Join Date
    09-27-2018
    Location
    london
    MS-Off Ver
    excel
    Posts
    69

    Getting a Given Number from Either of Two Columns

    Hi Guys,

    I wondered if you can help me pls

    I need to look for a given number in a set of data but the result I want to get can be in either of two columns:


    FROM
    Document No_ A B
    ST1986874 TAXABLE eu services
    ST1986870* eu goods TAXABLE
    ST1986878 TAXABLE TAXABLE
    ST1986871 TAXABLE eu services
    ST1986870* eu goods TAXABLE


    TO
    Document No_ A/B
    ST1986874 to bring the result into
    ST1986870
    ST1986878
    ST1986871
    ST1986870


    Note, sometimes the same number may appear twice


    Thanks

    Vito
    Last edited by AliGW; 02-14-2019 at 09:39 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,277

    Re: Getting a Given Number from Either of Two Columns

    Please make sure your thread titles are more descriptive. I have updated this one for you this time.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-27-2018
    Location
    london
    MS-Off Ver
    excel
    Posts
    69

    Re: Getting a Given Number from Either of Two Columns

    Thank You!

  4. #4
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Getting a Given Number from Either of Two Columns

    Looking at your "From" and "To" data it looks as simple as the following (assuming your data starts in A2).
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I suspect however that it is not this simple. You mention that the result you want can be in either of 2 columns, but your sample data does not reflect that.

    Please attach a workbook with sufficient sample data to cover all necessary cases along with your expected results for each.

    To attach a file, first make sure to remove any sensitive/proprietary data and then click on “GO ADVANCED” and then scroll down to “Manage Attachments” to open the upload window. Choose your file then click on “Upload”, scroll down then click on “Close this window”, then “Submit reply”.

    Thanks

    Geoff

  5. #5
    Registered User
    Join Date
    09-27-2018
    Location
    london
    MS-Off Ver
    excel
    Posts
    69

    Re: Getting a Given Number from Either of Two Columns

    Hi,

    Thanks for coming back to me

    Please see attached as requested


    Thanks

    Vito
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,277

    Re: Getting a Given Number from Either of Two Columns

    Try this in B10 copied down:

    =IF(AND(VLOOKUP(TRIM(A10),$A$2:$C$6,2,0)="TAXABLE",VLOOKUP(TRIM(A10),$A$2:$C$6,3,0)="TAXABLE"),"TAXABLE",SUBSTITUTE(VLOOKUP(TRIM(A10),$A$2:$C$6,2,0)&VLOOKUP(TRIM(A10),$A$2:$C$6,3,0),"TAXABLE",""))

  7. #7
    Registered User
    Join Date
    09-27-2018
    Location
    london
    MS-Off Ver
    excel
    Posts
    69

    Re: Getting a Given Number from Either of Two Columns

    Thank you, it works like a dream!

    Cheers

    Vito

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,277

    Re: Getting a Given Number from Either of Two Columns

    You're welcome!

    I had to use TRIM as the lookup values have trailing spaces.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] INDEX+MATCH instead of VLOOKUP+MATCH, why is INDEX a better choice and how to re-write?
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2016, 10:54 AM
  2. [SOLVED] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  3. [SOLVED] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  4. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  7. Replies: 3
    Last Post: 05-02-2013, 01:31 AM

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