Consulting

Results 1 to 13 of 13

Thread: Solved: Compare the values between two columns

  1. #1
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location

    Smile Solved: Compare the values between two columns

    Hi All,

    Here is my Requirement !
    I want to compare two columns Code and GL.
    If the value of cell in GL column is CAP then the value of cell in Code should start with 1, similarly if GL value is TRS then Code value should start with 2 and similarly if GL value is R then the code value should start with 3.

    The comparision should be on either column. If the above defined rules deviates then the entire row to be copied to sheet 2 of the same file as they are with different different values.

    Also values in the code other than starting with either 1,2 or 3 needs to be deleted.

    I have also attached the file for the reference.
    Quick help will be highly helpful !!!

    Thanks for all your help in advance...
    -Sindhuja

  2. #2
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi sindhuja,

    Like this?
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  3. #3
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location
    Hi,

    This is what i needed.

    thanks for you help !

    -Sindhuja

  4. #4
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location
    Hi,

    Just an addition to my need...

    For a single match ID, there should be same GL, same Fund ,same class...
    If anything is different then, all the values should be retrieved and updated in the sheet2.

    Attached the file for the reference...

    -Sindhuja

  5. #5
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi,

    I think i need more explanation!

    Exactly what are we comparing?

    What do you mean "...all the values should be retrieved and updated in the sheet2."
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  6. #6
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location

    Smile

    Sure Rhodes,
    Last edited by sindhuja; 04-18-2008 at 09:25 PM.

  7. #7
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location
    Sure Rhodes !

    Here is the scenario...
    We will match the values only when fund, gl and class is the same. If there is a difference in values then those must be retrieved and updated in the sheet 2.

    In the below example, second line is the with the fund # 83 which is difference from others for a match ID, so that is to be retrieved. There is also exceptions cases where a single match ID can have different fund values provided gl must be RF.

    Fund # Class GL Match
    7 21000 TRS 7927342
    83 21000 TRS 7927342
    7 21000 TRS 7927342

    Hope i made it clear...

    -Sindhuja

  8. #8
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Thanks, I'll look at it
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  9. #9
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location
    Hi,

    Any comments on this please....

    -Sindhuja

  10. #10
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location

    Question

    hi,

    This is really a concern for me...
    Please help me out in my requirement...

    -Sindhuja

  11. #11
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi sindhuja,

    I forgot about this one...long enought that a fresh look helpred me figure it out (I think). One question tho:

    The original request was for three codes:

    CAP = 1
    TRS = 2
    R = 3

    Now you add RF:

    "There is also exceptions cases where a single match ID can have different fund values provided gl must be RF"

    Where does RF come from? The attached example will delete any rows that are RF because RF doesn't match CAP,TRS or R.
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  12. #12
    VBAX Mentor
    Joined
    Sep 2007
    Posts
    405
    Location
    Hi,
    Thanks for the heads up..!

    The RF is same as R

    And also I have highlighted the expected output
    Need the data which is difference in a single match ID

    Hope this will be clear..
    -Sindhuja

  13. #13
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi Sindhuja,

    This works on your example. It looks for "R" only so will handle "R" or "RF".

    Try it out...
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •