+ Reply to Thread
Results 1 to 5 of 5

Return Cost Value Based on Two Other Cells.

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    14

    Return Cost Value Based on Two Other Cells.

    Formula Test.xlsx I need help getting Excel to return and expected value based on City and work code. On sheet 1 Employees can enter a work code in column E beginning in cell 24 currently cell f24 and g24 return a value, but pay no attention to cell M3. I need to modify the formula in cell G24 so that it returns a price based on the city in cell M3. M3 is a drop down that gets it data validation information from the 2nd sheet which also defines the work codes descriptions and cost per market. Row 25 has been manually calculated to return the expected value based on the cost code entered in E25 and the city entered in M3. I have tried combinations of vlookup's, nested if statements index and match but I seem to be missing something. Any help is greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Return Cost Value Based on Two Other Cells.

    Try
    Please Login or Register  to view this content.
    which basically does the vlookup but uses a match on your Costs table to find which column to return for your required city.

    EDIT John's slightly different version below is the right one to use, I always forget to lock the ranges with $
    Last edited by pjwhitfield; 09-12-2022 at 02:41 PM.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,741

    Re: Return Cost Value Based on Two Other Cells.

    Try

    =IF($E24="",0,VLOOKUP($E24,'Work Costs'!$A$3:$G$123,MATCH($M$3,'Work Costs'!$A$2:$G$2,0),0))
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

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

    Re: Return Cost Value Based on Two Other Cells.

    With index / match / match

    K5 =INDEX('Work Costs'!$A$2:$G$15,MATCH($K$3,'Work Costs'!$A$2:$A$15,0),MATCH($M$3,'Work Costs'!$A$2:$G$2,0))

    See the attached file.
    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.

  5. #5
    Registered User
    Join Date
    01-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Return Cost Value Based on Two Other Cells.

    Quote Originally Posted by JohnTopley View Post
    Try

    =IF($E24="",0,VLOOKUP($E24,'Work Costs'!$A$3:$G$123,MATCH($M$3,'Work Costs'!$A$2:$G$2,0),0))
    Bingo, This works perfectly.

+ 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] How to return the month in which a cost is first and last incurred
    By Jimbo79 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-10-2022, 12:49 AM
  2. [SOLVED] Return a cost price or alternative cost price
    By jimbokeep in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-22-2019, 10:15 AM
  3. Employee cost allocation across cost centers based on percentage
    By MRIRIF in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2018, 12:54 PM
  4. Formulaa to calculate a cost, based on prior cells
    By robiton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2017, 01:18 PM
  5. Replies: 3
    Last Post: 11-29-2015, 09:33 PM
  6. [SOLVED] Outputing engineering cost based on total cost of project. Looking for help with matching
    By cadamhill in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-17-2012, 09:31 PM
  7. cost based on number of units where cost changes
    By jbowling in forum Excel General
    Replies: 3
    Last Post: 08-22-2011, 02:36 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