+ Reply to Thread
Results 1 to 8 of 8

Change Cell Value Based on INDEX/MATCH Criteria

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Change Cell Value Based on INDEX/MATCH Criteria

    Hello Everyone,

    I'm running into a little issue and I'm hoping someone can help me. I'm looking to change the value of a cell based on a VLOOKUP. Using the attached spreadsheet information as an example, I'd like to write code that says "In Sheet2, Column B, if you INDEX/MATCH the adjacent value in column A to Sheet1, and the value comes out as either Wednesday or Friday, then multiply the value by 1000." In the spreadsheet, you will see that "James" and "Joe" are next to "Wednesday" and "Friday" respectively on Sheet1. Therefore, their values on Sheet2 Column B are multiplied by 1000 and the rest of the values are left alone.

    ChangeValueUsingVLOOKUP.xlsm

    If someone could help me figure out the best way to code this, I'd really appreciate it!

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    List your original values in B1, and in C1, enter =IF(OR(INDEX(Sheet1!$A$1:$A$7,MATCH(A1,Sheet1!$B$1:$B$7,0))="Wednesday",INDEX(Sheet1!$A$1:$A$7,MATCH(A1,Sheet1!$B$1:$B$7,0))="Friday"), B1*1000,B1) then fill the formula
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    See the green cells in the attached file.

    I made this with a vlookup after a index/match.

    The formula is in the sheet.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,945

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    Perhaps this, copied down?

    =IF(SUM(COUNTIFS(Sheet1!$A$1:$A$7,{"Wednesday","Friday"},Sheet1!$B$1:$B$7,Sheet2!A1))=1,B1*1000,B1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    Hi JieJenn,

    Thank you for your attempt. However, I was hoping to do this without the use of another column. That's where the complexity comes in. Otherwise, just calculating the value in a different column would be a cinch.

    Thanks

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    What is the trouble of a helping column (such as JieJenn used)?

    You can hide a column if you want.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,945

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    Sometimes, using a helper column makes a lot of sense...it helps keep things relatively simple, and can help avoid overly-complex/ARRAY formulas - it can also help with understanding the flow/sequence of your process. The helper can always be hidden if needed.

    I did not uise a helper, but I could have

  8. #8
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    228

    Re: Change Cell Value Based on INDEX/MATCH Criteria

    Hey Everyone - I agree that helper columns can definitely make things easier when trying to understand the process. As for this project, I was looking more for something that I can code in VBA that would update the necessary cells, not a formula within the cell (or helper column).

    I can always use a helper column to build the formula then copy and paste the values into Column B and delete the helper column, but again, I was hoping to be able to find code that could just update the necessary values.

    Thanks again for all your help! I really appreciate it!

+ 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. Index & Match Based on Criteria
    By cychua in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-03-2013, 06:03 AM
  2. Index-Match based on 3 criteria
    By Johnelbek in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-16-2013, 08:10 AM
  3. Index Match based on 2 Criteria only returning 1 match
    By stsanders22 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2012, 11:26 PM
  4. Index / Match / Large based on a criteria.
    By SimpleJack in forum Excel General
    Replies: 7
    Last Post: 06-20-2012, 08:04 AM
  5. Index and Match Based on Multiple Criteria
    By duranbeaz in forum Excel General
    Replies: 2
    Last Post: 05-22-2009, 04:37 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