+ Reply to Thread
Results 1 to 11 of 11

Formula for IF a cell in A1=C1, B1=D1, but more complicated

  1. #1
    Registered User
    Join Date
    08-27-2019
    Location
    Sydney
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Hi All,

    I need a way to auto populate a cell with a number from another worksheet if the field parameter matches.

    Example (similar to below)
    If a Cell within Column 1 (worksheet1) = a Cell within Column 1 (worksheet2), then Cell in Column 2 (W1, same row) = Cell from Column 2 (W2, same row)

    Now this may be easy for the experts here, but what needs to be done is that if there are multiple entries as per attached, the average of the scores is given. The formula would need to work if there is 1 option or any number of multiple options. Example.JPG

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,701

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Try this in B2 of Sheet1:

    =AVERAGEIFS(Sheet2!$B:$B,Sheet2!$A:$A,A2)

    then copy down.

    Hope this helps.

    Pete

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,691

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Welcome to the Forum Rugz06!

    I think you may want this in B2, and copy down:

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


    But there are couple of things we need to clear up in your description.

    First, note that you can attach a file here. You often get better responses if you attach an Excel file that has sample data and a sample of what you want results to look like.*

    When talking about columns, please use letters, like Excel does, instead of numbers

    Your example shows x, y, and z instead of the actual answers you would expect to see for this data. It would be helpful to show an example that is as realistic as possible.

    These two lines seem to say different things:

    If a Cell within Column 1 (worksheet1) = a Cell within Column 1 (worksheet2), then Cell in Column 2 (W1, same row) = Cell from Column 2 (W2, same row)

    if there are multiple entries as per attached, the average of the score is given.

    So the value for Pete in column B for Pete should be 56.666666667?

    And what is an "option"? "need to work if there is 1 option or any number of multiple options"

    ___________________________
    *The paper clip icon does not work for attachments. To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    08-27-2019
    Location
    Sydney
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Thankyou for your warm welcome and quick responses.

    The formula posted by Pete UK does work for the simple example posted above. Now I have played around with it to try to get it to suit my situation and have been unable to get it to work after about an hour or so.

    I have tried attached the actual working sheet (with data removed) but am unable to for some reason. Might be my work computer settings. I cant post a link to the drop box due to being a new user, so your help in getting the correct columns and search fields would be greatly appreciated.. All i can do is post a few screenshots.

    Now using the example above, My "Sheet1" = "Master List" and "Sheet2" = "F084 Subcontractor Review". I have highlighted the columns in yellow. I need the averages from F084 Column AG for all entries against that company in Column F to be brought across into Master List AQ against the Company listed in Column B

    Data1.JPG
    Data2.JPG
    Data3.JPG
    Data4.JPG

    Thankyou.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,395

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Please attach the workbook with DUMMY DATA included (not empty cells).

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years, and despite our repeatedly asking the technical team who own the forum to fix it, they can't be bothered to do so), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    08-27-2019
    Location
    Sydney
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Thankyou.

    Test File attached.
    Attached Files Attached Files

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,701

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Make sure that all the numbers in column AG of the F804 sheet are set to percentages - otherwise, you will be taking a average of the numbers 90 and 0.75 in this example.

    Then you can use this formula in cell AQ2 of the Master sheet:

    =AVERAGEIFS('F084 Subcontractor Review'!$AG:$AG,'F084 Subcontractor Review'!$F:$F,B3)

    Set the format as percentage, and then copy it down as required.

    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    08-27-2019
    Location
    Sydney
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    It worked. Thankyou!

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,701

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Glad to hear it.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  10. #10
    Registered User
    Join Date
    08-27-2019
    Location
    Sydney
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Pete,
    What if the number was replaced with just a word. And I didnt want the average because there would only be 1 entry in the column.

    Basically the same condition if the cells match, but rather than the average of the numbers, I wanted it to equal that 1 cell.

    So from the attached example, If a cell within !Master List! Column B matches !F084! Column F, then !master list! cell in that row = Column AH Cell

    Thanks
    Attached Files Attached Files
    Last edited by AliGW; 08-30-2019 at 01:12 AM. Reason: Please don't quote unnecessarily!

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,701

    Re: Formula for IF a cell in A1=C1, B1=D1, but more complicated

    Use this in cell AQ3:

    =IFERROR(INDEX('F084 Subcontractor Review'!AH:AH,MATCH(B3,'F084 Subcontractor Review'!F:F,0)),"")

    then copy down.

    Hope this helps.

    Pete

+ 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. Need help with complicated IF formula
    By sparker08 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-19-2015, 03:44 PM
  2. Complicated Formula (to me)... Please help
    By OdetteP in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2013, 04:06 PM
  3. [SOLVED] Need a complicated formula to display part of current workbook name in a cell
    By ianpwilliams in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-06-2013, 01:41 PM
  4. Complicated formula to evaluate multiple strings in cell
    By jacquiG in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-09-2012, 01:44 PM
  5. Need a complicated IF formula (maybe?)
    By lroffler in forum Excel General
    Replies: 2
    Last Post: 10-10-2011, 01:42 PM
  6. Complicated Formula
    By Exxodus in forum Excel General
    Replies: 2
    Last Post: 06-01-2011, 09:04 AM
  7. Rather Complicated Formula
    By paulmaddock in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-08-2008, 09:36 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