+ Reply to Thread
Results 1 to 20 of 20

Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

  1. #1
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Hello

    I am trying to extract a figure from sheet 2 into sheet 1.
    Sheet 2 is a list of company names running across the sheet and running down the sheet are groups of services, with rows in the groups containing individual hourly rates by professions. The cells are the service rates by profession by company.
    An average hourly rate has been calculated by company and service, 6 rows below the service category heading. There are 99 companies tendering for about 9 services.

    On sheet 1 is a listing of all the companies running vertically and a variable cell relevant to the service beng tendered for.

    I would like to be able to change the service on sheet 1 and have a formulae extract from sheet 2 the corresponding average hourly rate for each company.

    There are a number of attempts at formulae that have resulted in nothing.

    I would appreciate any help.

    Thankyou
    Gezza

  2. #2
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Hi and welcome to the forum

    Your formulas in C seem to be referening another workbook. I would suggest that you manually enter a few sample answers so we can see where they come from
    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

  3. #3
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Sorry about that. Thanks for the heads up.
    I have linked the answers to sheet 2 for the variable "1.4.1*LANDSCAPE ARCHITECT"
    Another point is the result is actually 7 rows below not 6 as previously stated.

    "An average hourly rate has been calculated by company and service, 6 rows below the service category heading."

    C6 =Sheet2!E243 $-
    C7 =Sheet2!G243 $-
    C8 =Sheet2!H243 $-
    C9 =Sheet2!J243 $134.25
    C10=Sheet2!L243 $-
    C11 =Sheet2!N243 $-
    C12 =Sheet2!P243 $-
    C13=Sheet2!R243 $131.75

    I couldn't work out how to update the file, so I have added the reference instead.
    I have now uploaded revised file.

    Thanks.
    Attached Files Attached Files
    Last edited by Gezza24; 11-01-2013 at 02:30 AM.

  4. #4
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    To assist and outline that I have tried to resolve the formulae, I have tried a number of combinations of vlookups, hlookups, if, offset and index functions but lost the formulae when updating with actual figures as suggested by FDibbins.

    All help is greatly appreciated.

    Thanks

  5. #5
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Has anyone got any tips on how I might attack this problem, I am still struggling to resolve it.

  6. #6
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Smile Re: Dynamic-multiple-criteria-lookup

    I am thinking the solution may be something like this suggestion of another query
    http://forum.chandoo.org/threads/dyn...-lookup.12997/
    Hopefully I am hopeful I am not breaking a forum rule by posting a link to another site. It didn't appear to be the case in the forum rules. I am happy to stand corrected if I am wrong.

    Thanks
    Last edited by Gezza24; 11-02-2013 at 10:06 AM. Reason: Renamed dynamic-multiple-criteria-lookup from Locate cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

  7. #7
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    "Bump - no response"

  8. #8
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    You did not explain how you select the row you wanted (and how this could be repeated for each section). This will pull the data you want, but I had to manually code the row number (7), but from the looks of it, it will not always be the 7th row?...
    =OFFSET(INDIRECT("Sheet2!"&ADDRESS(MATCH($B$2,Sheet2!$C:$C,0),3)),7,MATCH($B6,Sheet2!$C$15:$GS$15,0))

    If you can help me to understand how you would pick the specific row in a section, we can try and get that part automated too

  9. #9
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Thanks for your response.

    The row is selected by the variable in sheet 1 at cell B2.
    Cell B2 has a drop down list of options (it didn't carry through in the simplified example attached)which are the service on sheet 2.
    i.e.
    1.1.1 ARCHITECT,
    1.1.2 INTERIOR DESIGN,
    1.2*BUILDING CERTIFICATION AND AUDIT,
    1.3.1 CIVIL ENGINEERING DESIGN,
    1.3.2 ELECTRICAL ENGINEERING DESIGN,
    1.3.3 FIRE SYSTEMS DESIGN,
    1.3.4 HYDRAULIC ENGINEERING DESIGN,
    1.3.5*MECHANICAL ENGINEERING DESIGN,
    1.3.6*SECURITY/CCTV DESIGN
    1.3.7*STRUCTURAL ENGINEERING DESIGN
    1.4.1*LANDSCAPE ARCHITECT
    1.4.2*LANDSCAPE
    1.5*PROJECT MANAGEMENT
    1.6*QUANTITY SURVEYING
    and this list may be expanded

    In sheet 1 the variable is
    1.4.1*LANDSCAPE ARCHITECT (at B2)

    I hope that is the information you were seeking.

    For those services for which the average rate is not 7 rows below the service title (i.e. 1.2 BUILDING CERTIFICATION AND AUDIT) I will modify the format so that all averages will be 7 rows below the service, in sheet 2.
    Last edited by Gezza24; 11-03-2013 at 01:32 AM. Reason: clarify information

  10. #10
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    1.1.1 ARCHITECT,
    1.1.2 INTERIOR DESIGN,
    1.2*BUILDING CERTIFICATION AND AUDIT,
    1.3.1 CIVIL ENGINEERING DESIGN,
    1.3.2 ELECTRICAL ENGINEERING DESIGN,
    1.3.3 FIRE SYSTEMS DESIGN,
    1.3.4 HYDRAULIC ENGINEERING DESIGN,
    1.3.5*MECHANICAL ENGINEERING DESIGN,
    1.3.6*SECURITY/CCTV DESIGN
    1.3.7*STRUCTURAL ENGINEERING DESIGN
    1.4.1*LANDSCAPE ARCHITECT
    1.4.2*LANDSCAPE
    1.5*PROJECT MANAGEMENT
    1.6*QUANTITY SURVEYING
    Yes, I get that, that is for each option in the D/D. But within each of those, you have a further breakdown...
    C
    236
    1.4.1*LANDSCAPE ARCHITECT
    237
    Principal
    238
    Senior
    239
    Mid-level
    240
    Graduate
    241
    Draftsperson
    242
    Technical Officer
    243
    Other – Please add details


    You have selected the data from row 243, what determines/decides, that that is the row (from that category) to choose. What Im saying is, how would I know that is the row to use (so that I can build a formula that will select that row) - what is the criteria...why did you select "Other – Please add details" and not "Draftsperson", for instance?

  11. #11
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Sorry for the confusion. It essentially poor spread sheet design and it was done in a hurry.

    A better design would have row 243 titled "average", not other and row 244 titled other. Those in pink format have been provided by tendering companies and are outside the scope of what was requested, but they have been captured as a reference.

    My apologise for being tardy.

    I have input the formulae and it is appears to be providing the exact result I was seeking.

    You are a legend and I thank you greatly for your assistance. I will mark the thread {SOLVED} once I get back to work (tomorrow) and test it on the full version and I will also add to your reputation.

    As an aside, how can I best start to give back to this forum that has helped me out on a couple of tough formulas in recent years?

    Thanks again
    Gezza
    Last edited by Gezza24; 11-03-2013 at 02:01 AM. Reason: correct content

  12. #12
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Thanks for the kind words, they are always most welcome and appreciated

    regarding my formula...
    =OFFSET(INDIRECT("Sheet2!"&ADDRESS(MATCH($B$2,Sheet2!$C:$C,0),3)),7,MATCH($B6,Sheet2!$C$15:$GS$15,0))

    That will ONLY pull in data/values/answers that are exactly 7 rows down from the "heading", hence my question regarding how you select that specific row. Some of those "sets" have far more rows in them than others, and we need to be able to ID which row to pick...just picking "row 7" will not always work, will it?

    (1.4.2*LANDSCAPE is 6 rows, 1.5*PROJECT MANAGEMENT is only 5 rows to that "others" row)

    On a side note, "1.4.2*LANDSCAPE " has 5 trailing spaces at the end. This could cause problems if you need to refer to that text string in a formula (dont know if any others have the same problem, just noticed that 1)
    Last edited by FDibbins; 11-03-2013 at 02:11 AM.

  13. #13
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    I will make row 7 work.

    A decision was made to only assess the company rates on the average of the first 4 rates (Principal, Senior, Mid-level, Graduate) if the company has provided 4 figures.
    If less than 4 have been provided the average will be only on those provided.

    For most , 7 rows beneath each heading is a formulae that averages the figures of the first 4 rows (Principal, Senior, Mid-level, Graduate) based on if they have a figure entered that is greater than 0.
    If there are only 2 entries it will average over the 2, and if 4 then average over the 4.
    (1 set is to be changed to fit this standard i.e. 1.2 BUILDING CERTIFICATION AND AUDIT which will needs 4 rows added i.e. Mid-level, Graduate, Draftsperson, Technical Officer)

    Your solution is perfect for me. I have full flexibility on the layout of the worksheets, so I will adjust them to suit the formulae seeing as it does EXACTLY what I was looking to achieve but had no idea on how to achieve it.
    I will, when time permits, research the functions that you have used so that I have a better understanding of what you have generously provided.

    Again I am wrapped with your solution as I have been able to achieve my desired outcome and I know it will blow a few people away tomorrow. You will not be forgotten.

    Have a magnificent night / morning / day. Is it really )Time in Duncansville, PA, USA - 1:31 AM Sunday, November 3, 2013 (EST), )

    Gezza

  14. #14
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Have a magnificent night / morning / day. Is it really )Time in Duncansville, PA, USA - 1:31 AM Sunday, November 3, 2013 (EST), )
    yes that is probably what the time was then, I work 2nd shift, so dont go to bed at normal human hours lol


    Again, thanks for the kind words, and I was happy to be able to help

  15. #15
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Hello once again.

    Unfortunately I have used the formulae in the main workbook and I am now getting a #value! error.

    Formulae entered is
    =OFFSET(INDIRECT("Hourly Rates!"&ADDRESS(MATCH($B$2,Hourly Rates!$C:$C,0),3)),7,MATCH($B6,Hourly Rates!$C$15:$GS$15,0))

    but when going back to edit the formulae I have discovered [Rates] has appeared in the formulae.

    =OFFSET(INDIRECT("Hourly Rates!"&ADDRESS(MATCH($B$12,Hourly[Rates]Rates!$C:$C,0),3)),7,MATCH($B16,Hourly [Rates]Rates!$C$15:$GS$15,0))

    Is there some hidden code? Why would the[Rates] text appear in the formulae?

    When I go to update the formulae with [Rates] in it I get prompted to "Update Values:Rates".

    In the simplified workbook the formulae works fine. Any help would be appreciated.
    Last edited by Gezza24; 11-03-2013 at 11:31 PM.

  16. #16
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Hard to say without seeing what the exact error message looks like/refers to, but check to make sure that the sheet names match exactly what you have in the formula.

    Also, my formula was...
    =OFFSET(INDIRECT("Sheet2!"&ADDRESS(MATCH($B$2,Sheet2!$C:$C,0),3)),7,MATCH($B6,Sheet2!$C$15:$GS$15,0))
    you have changed it to...
    =OFFSET(INDIRECT("Bus & AH Hourly Rates!"&ADDRESS(MATCH($B$12,Bus & AH Hourly Rates!$C:$C,0),3)),7,MATCH(B16,Bus & AH Hourly Rates!D15:GS15,0))

    If you have spaces in your sheet name, you need to change the...
    INDIRECT("Bus & AH Hourly Rates!"&
    to...
    INDIRECT("'Bus & AH Hourly Rates'!"& (not the extra ' before Bus and before !)

  17. #17
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Sorry I didn't see page 2 of the thread before sending my reply.

    The issue has been resolved for the moment, but I am not sure exactly what is/was occuring, but this was the issue identified / solution.

    The worksheet was previously labelled "Bus & AH Hourly Rates" and the formulae wouldn't work, as written below.
    =OFFSET(INDIRECT("Bus & AH Hourly Rates!"&ADDRESS(MATCH($B$12,Bus & AH Hourly Rates!$C:$C,0),3)),7,MATCH($B16,Bus & AH Hourly Rates!$C$15:$GS$15,0))

    Change the name to HourlyRates (no spaces) and it does work. (but the formulae had to be manually edited)
    =OFFSET(INDIRECT("HourlyRates!"&ADDRESS(MATCH($B$12,HourlyRates!$C:$C,0),3)),7,MATCH($B16,HourlyRates!$C$15:$GS$15,0))

    An issue arises when the name of the worksheet titled HOURLYRATES is changed to any name with a space, but only for the first part of the formulae
    i.e. =OFFSET(INDIRECT("HourlyRates!"&ADDRESS. It seems to be the part of the formulae enclosed in double quotation marks is having some impact.

    If the name of the worksheet tab is edited ( to say Hourly Fees) this "HourlyRates" reference in the formulae doesn't change, but the subsequent references (remaining part of formulae) do.
    i.e. (MATCH($B$12,Hourly Fees!$C:$C,0),3)),7,MATCH($B16,Hourly Fees!$C$15:$GS$15,0))

    The formulae then reads =OFFSET(INDIRECT("HourlyRates!"&ADDRESS(MATCH($B$12,Hourly Fees!$C:$C,0),3)),7,MATCH($B16,Hourly Fees!$C$15:$GS$15,0))

    I have also discovered that the inclusion of "&" in the worksheet name also has a negative impact. i.e Bus&AHHourlyRates (even with no spaces)

    So I can close this thread, can anyone explain why this behaviour with the formulae is occurring????

    Specifically why doesn't the reference to the worksheet name in the first part of the formulae update when the worksheet name is changed/modified.

    Thanks
    Last edited by Gezza24; 11-04-2013 at 05:53 AM. Reason: Replied without reading response on page 2.

  18. #18
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    with this formula...
    =OFFSET(INDIRECT("HourlyRates!"&ADDRESS(MATCH($B$12,Hourly Fees!$C:$C,0),3)),7,MATCH($B16,Hourly Fees!$C$15:$GS$15,0))...
    this part...
    =INDIRECT("HourlyRates!"&ADDRESS(MATCH($B$12,Hourly Fees!$C:$C,0),3))
    in this part, "HourlyRates" is text, not a reference. INDIRECT is a function that converts text into a reference that excel can use in a formula. I need to enter the sheet name "manually" so that I can "add" it to the discipline to find its location.

    as far as the rest of the formula is concerned, that worked because I was referencing the sheet name directly, so when the sheet name changed, so did the references to it

    Regarding the spaces in the sheet name. If there are spaces in the name, the name needs to be wrapped in '...' so sheet1!a1 becomes "sheet 1'!a1. Try it yourself. On sheet1, reference sheet1 A1, look at the formula, then change the sheet name to sheet 2, and look at the formula again

  19. #19
    Registered User
    Join Date
    01-28-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    Thanks for ALL of your help, you have helped me in a massive way. I would love to be able to shake your hand ~~~~~~~~~, but this is the best I could do.

    You have made me very .

    Thanks for the lesson on formulae writting also.

    This thread is solved and will be marked as so.

  20. #20
    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,929

    Re: Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.

    It was a pleasure being able to help you, and thank you for the kind words and feedback

+ 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] Add Data in Different Sheets and Result in Master Sheet based on Cell Values
    By dksodhi in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-18-2013, 01:08 PM
  2. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  3. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 PM
  4. Formula for locating cell in another sheet?
    By Yappa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-19-2008, 01:24 PM
  5. Locating data based on cell color & pasting to new sheet
    By riggsd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-10-2005, 04:23 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