+ Reply to Thread
Results 1 to 20 of 20

Comparing two columns, and returning values in the 4th column from the 3rd column

  1. #1
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Comparing two columns, and returning values in the 4th column from the 3rd column

    hi.
    abc.xlsx
    yyyyyyyyyyyyyy.jpgzzzzzzzzzzzz.jpg

    i have 1 worksheet say Accounts. There are columns A and B which correspond to each other. Then i have another worksheet say called Checks.

    Its column B is the same as that of column A of Accounts worksheet but with values spread out in no order.

    I want column C to be filled with the values of column B of Accounts worksheet but the values must correspond to based upon what is there in Column B of the Accounts worksheet.

    i have attached the excel file may you want to test it.



    Kindly help me in this.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    Hi,

    I can see no matches between column B on CheckExpenseItems and column A on Accounts. However if there were this formula would return the column B of accounts

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    hi richard.

    i tried the formula but it does not seem to work. can you have a look at the excel file uploaded above and kindly check why it is not working. i would be grateful my friend.

  4. #4
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    the file uploaded above contains many data than the one i showed above in the pics. my concern is the checks sheet. 2 columns of concern A and F in the accounts sheet.

    Checks sheet column AA is the same as A above with values unevenly dispersed. Yes the are the same if you scroll down you may find very few data similar. actually i exported just 100 transactions to excel from quickbooks so i think thats y this issue.

    anyhow i want to fill in column Y of Checks with values of column F of Accounts but with respect to column AA of Checks which will be matched (i think) to Column A of Accounts.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    Hi,

    I'm sorry but this is no clearer. Your original mentioned only columns A, B & C. Now you've thrown in F Y & AA.

    You need to clearly state which columns you want to compare, and then when a match is found between a value in a Sheet1 column and the same value in a Sheet2 column, which column from Sheet1 you want to pick up.

    But importantly you need to manually add the results you expect to see and tell us which is the column containing the results.

  6. #6
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    Hi Richard.

    I am sorry about that and i will try to make it simple this time. i am starting afresh here so consider the responses above as void. i have re-attached 2 snaps as under. Kindly see them. Each is from a worksheet within a workbook. there are 2 worksheets named Accounts and Checks.

    Accounts worksheet.jpgChecks Worksheet.jpg

    Accounts worksheet has 3 columns. Column B contain account names, column C contains the corresponding account codes and column A contains the corresponding ID.

    My concerned worksheet is Checks.
    in that, Column U contains some of the account names and the corresponding ID under column V (similar to columns A and B). i created an empty column W and want the account codes of Column C (Accounts worksheet) to auto-fill here based on the values in column V.

    I am new to excel so i don't know what to match with what or which values to lookup.
    simply put i want column W to show account codes as in Column C.

    Note that these worksheets are not limited to just 10 rows. so i need a formula that would do the job and which would apply to the whole Column W so that if any new entries are made i.e. beyond the 10 row, Column W would automatically display the account codes based upon what is there in either column U and/or V.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    Hi,

    Snapshots are little use to us (see guidance in the rules). Please upload the workbook and don't forget to manually add examples of the results, clearly explaining in notes in the workbook which are the results.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    I copied your snaps and created a workbook. Perhaps this is what you are looking for:
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  9. #9
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    thanx newdoverman.

    this is exactly what i want.

    can you provide me the formula without clicking the cells or columns. eg. instead of showing table1ID, rather show like $A$2:$A$10.

    you can provide me the formula for your own worksheet.

    i tried it myself but its not working that way so thats y i ask.

    one more thing if drag the last cell W10 further down will it automatically fill in the 4 digit codes (given that there is data entered in columns U and V beyond row10)

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    If I didn't make a mistake in translating the formula, this should be the equivalent using normal cell references:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    When in a table, don't drag the formulae down, go to the last cell in the table (lower right) and hit the TAB key. This will insert a new row into the table and bring with it the formulae from the row above it. That is the advantage of tables over ranges.

  11. #11
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    thanx for the formula newdoberman.

    i myself first translated to this same formula but it is not working for me. dont know where i am going wrong.
    i have attached the excel sheet of mine.

    kindly let me know where i am going wrong. the formula is pasted there so everything is ready for you this time.

    qwqwqw.xlsx

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    I fixed a couple of things. In the formula, the MATCH was referring to the wrong column and the values should have been numbers instead of text if you ever wanted to do calculations without problems. The formula was also in a column formatted as TEXT instead of GENERAL.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    thank you so much newdoverman. it worked.

    God bless you

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    You're welcome. I'm happy that it worked for you.

  15. #15
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    Hello newdoverman.

    i have an assigment to submit tomorrow. may you kindly help me out in this. i have tried to setup files and explanations here to my best so to save your time.

    There are 3 worksheets here. BillExpenses, BillPayments and PV.
    I used data validation to create a drop down list in the PV worksheet under PV NO. the source has been used from worksheet BillExpenses. The source formula can be viewed in column K.
    I need to fill in the headings called Account Title, A/C Code, Project Code, Debit and Credit in the PV template.
    I have used vlookup formula to work on the PV template from BillExpenses worksheet.
    I am stuck now at using the BillPayments worksheet.

    Kindly see the pictures for a better understanding. I need to match Column C [BillID] of BillExpenses worksheet with that of Column A [ID] of BillPayments worksheet.
    The BillPayment column A shows to sets of numbers where you can see it matches with one of Column C of BillExpenses worksheet.

    I want to match not just the columns but to identify the similar text or number and then to return the values of that row where it matches (from the BillPayments worksheet) and post the values in the PV worksheet under my desired rows.

    See PV picture to get better understanding and for the rest.

    BillExpense1.jpgBillPayments.jpgPV.jpg

    Kindly help me in this and I will be utmost grateful folks.
    The excel file is also attached may you want to view the formulas used or to test it.


    test.xlsx

    a dropbox link is also available for this excel file. its as under:

    https://www.dropbox.com/s/oyqhcoigd93osxh/test.xlsx

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    This should give you a start. There is a problem with your drop down list. It is showing an error of numbers stored as TEXT. This is a result of the formula that produces the numbers for the drop down list. They are TEXT numbers. To convert them to "real" numbers multiply the formula that creates the list by 1 or do some other math operation like +0. The formula then becomes:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    enter with Ctrl + Shift + Enter

    The formula for the name ABC can now be:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This makes ABC a dynamic list.

    I filled in part of the PV worksheet, the rest if needed, I think you can figure out.

    The numbers in column A of the first worksheet were again TEXT. I clicked on the error message and converted the numbers to real numbers. Unless there is a reason to have numbers as TEXT leave them as NUMBERS by default.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    thank you so much newdoverman for helping me once again and taking out time to explain this much.

    just one thing i want to know though i did not need it here but still am curious. where ever i applied the vlookup formula in the PV template it did not work and showed N/A instead. and why would one need to convert text numbers as real numbers. what is the benefit over it when i think i will get the same results or is it something that may cause problems afterwards.
    the way i know to change the text numbers to real numbers is pressing Ctrl+1 on a cell and if it shows text change it to general. it this right ?

  18. #18
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    The N/A value not available. This was a problem with your drop down list in that some of the numbers in the drop down were text numbers and some were not and they didn't match up with the lookup values. Errors were also present when a text number was chosen from the drop down list. It still worked but why have errors when you can get rid of them at the source.

    The reason for having numbers as "real" numbers as default is that you never know what your future requirements are going to be and where real numbers will be required....better to eliminate potential future problems early in development than to try and correct problems when it won't be so easy.

    Ctrl + 1 will bring up the formatting dialogue box. Unfortunately it won't change a text number to a real number. Text numbers that I have seen have a green triangle in the upper left corner of the cell. If you click on the cell a yellow box with a ! in it shows up. Right click the yellow box and choose to convert to number. If several cells are selected, all cells will be converted at the same time.

  19. #19
    Registered User
    Join Date
    03-08-2014
    Location
    islamabad, pakistan
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    thank you so much for this useful information.

  20. #20
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing two columns, and returning values in the 4th column from the 3rd column

    You're welcome.

+ 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. Replies: 2
    Last Post: 11-14-2013, 01:44 PM
  2. Comparing 2 columns and returning a value of a 3rd column
    By usmc0331 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-17-2013, 10:55 AM
  3. Replies: 8
    Last Post: 12-25-2011, 08:39 PM
  4. comparing values and returning different column
    By JustMe602 in forum Excel General
    Replies: 12
    Last Post: 06-01-2007, 11:40 AM
  5. [SOLVED] Comparing values and returning the column heading
    By Steven Brobst in forum Excel General
    Replies: 3
    Last Post: 02-04-2005, 10:06 PM

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