+ Reply to Thread
Results 1 to 5 of 5

If a match, then enter corresponding value

  1. #1
    Registered User
    Join Date
    12-09-2020
    Location
    California
    MS-Off Ver
    the latest
    Posts
    3

    If a match, then enter corresponding value

    I work for a nonprofit and we have to complete lengthy excel workbooks, much of which i have begun to automatize to reduce duplicate data entry. But I am stuck on this one and appreciate your help. I'm using generic cell titles to keep things simple and relatable. Here is a google version since the forum isn't letting me upload the excel file

    (it's the drive.google.com/file address followed with: /d/1jMCWJt7wimRQQ84F2eTThy3jzm2qKEQM/view?usp=sharing )

    Imagine 2 worksheets from a bigger workbook. First worksheet "Primary Chart" has customer IDs auto inputted from data entered earlier in the workbook. There is the option to add Total Purchases next to each customer ID.

    Said Purchase details are on the 2nd worksheet, again with Customer IDs listed (aka Data Source). Not all customers listed in the primary chart will have purchased something.

    Goal is to have any purchase totals from 2nd worksheet Data Source over to the Primary Chart, entered next to the corresponding customer ID.



    I tried if/then formulas but was having to account for every possible customer ID so i know that's not the solution. Any help would be greatly appreciated!

    Thank you,

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: If a match, then enter corresponding value

    try a SUMIF()

    =SUMIF( Range with customer ID in 2nd worksheet, customer ID in first work sheet, Range to sum on 2nd worksheet)

    can not open the example spreadsheet
    See the yellow banner above to attach a sample, try creating a small sample sheet with NO REAL info

    Heres a sample of above
    Attached Files Attached Files
    Last edited by etaf; 12-09-2020 at 02:06 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: If a match, then enter corresponding value

    If you have the latest version of Excel then.

    =SORT(UNIQUE(Customers!A:A))

    Would return a sorted list of your customers from Column A of the Customers List.
    One issue that the list ends with a 0 which refers to the empty cell in Column A.

    You can either ignore that or use a method to find the last used cell in column A
    =SORT(UNIQUE(INDIRECT("Customers!A2:A"&MATCH("zzzzzzz",Customers!A:A))))

    You can then use the SumIf function to return the sales by customer
    =SUMIF(INDIRECT("Customers!A2:A"&MATCH("zzzzzzz",Customers!A:A)),A2,INDIRECT("Customers!C2:C"&MATCH("zzzzzzz",Customers!A:A)))



    Ok the next problem is that if you add customers on the Customer List, The sorted unique list is updated automatically.

    However you have to manually extend the Sumif Formula.

    There is normally an easy solution to that. Use a table. The table will extend your formulas automatically....... Nope Not if it uses the Spill feature.

    So Modify your formulas.

    A2 =INDEX(SORT(UNIQUE(INDIRECT("Customers!A2:A"&MATCH("zzzzzzz",Customers!A:A)))),ROW()-1)
    B2 =IF(A2="","",SUMIF(INDIRECT("Customers!A2:A"&MATCH("zzzzzzz",Customers!A:A)),A2,INDIRECT("Customers!C2:C"&MATCH("zzzzzzz",Customers!A:A))))

    Now you can use a table.

    Just Checked the table and the formulas are not extended automatically. hmmm.
    I will leave the table there while I play around.

    Are you allowed macros? I could easily use a macro to extend the table.


    This Macro will expand your table automatically.
    Please Login or Register  to view this content.

    This Macro will run the ExpandT Macro automatically it is sheet specific.
    Right Click On Your Sheet Name "Customers" At the Bottom Of Excel and Select View Code to see it.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 12-09-2020 at 03:12 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    12-09-2020
    Location
    California
    MS-Off Ver
    the latest
    Posts
    3

    Re: If a match, then enter corresponding value

    OH MY GOD! This works perfectly. I have just been staring at it for the last thirty minutes, marveling, trying to figure out how it works its magic. Thank you. I've updated the workbook accordingly. You have indirectly helped the homeless by helping me get this workbook in better working order.

  5. #5
    Registered User
    Join Date
    12-09-2020
    Location
    California
    MS-Off Ver
    the latest
    Posts
    3

    Re: If a match, then enter corresponding value

    Thank you very much for taking the time to look through this. I'm actually going to borrow the tricks you did for a different task at hand. Much appreciated. You have indirectly helped the homeless today for my nonprofit employer=) Thank you!

+ 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: 1
    Last Post: 10-22-2019, 02:16 AM
  2. [SOLVED] VBA macro to enter match value
    By Solvax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2018, 05:45 PM
  3. [SOLVED] If cell meets date requirement enter 1, if not enter 0, if blank don't enter anything.
    By billrogers184 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-11-2017, 02:04 PM
  4. [SOLVED] Enter number in blank cell match number on sheet 2 & enter data from adjacent cell
    By Bikeman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2015, 08:36 PM
  5. [SOLVED] Match text then enter formula
    By ChrisXcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2014, 08:09 PM
  6. Need help to Find the match then enter the value fr WB to WB after Double_Click
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 06-13-2013, 07:52 PM
  7. Match two values & enter a third
    By BJackson4552 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-15-2011, 04:14 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