+ Reply to Thread
Results 1 to 22 of 22

VLOOKUP / IF formula - HELP!

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    VLOOKUP / IF formula - HELP!

    Hi,

    I haven’t used VLOOKUP or IF formulas for some time now, but find myself in need of one! My colleague and I are developing a site that utilises football (or soccer!) result data. We have found a supplier who can issue us with an Excel sheet comprising all previous football results from the season. This data is presented to us as the attached Excel document.

    The columns consist of HOME TEAM, AWAY TEAM, HOME TEAM GOALS and AWAY TEAM GOALS. We would like to develop a formula that is able to ‘Look Up’ historic goals scored data, and display it against the forthcoming games schedule. For example, we would like to be able to have the forthcoming fixtures in a list like so…

    AGS Arsenal v Everton AGS
    AGS Liverpool v Tottenham AGS
    AGS Stoke v Fulham AGS

    ….and so on

    Next to each team (shown above as AGS), we would like to display the specific teams AVERAGE GOALS SCORED in their previous game. We have all the raw data from our supplier, we just require a formula to help us harvest it!

    Any help would be greatly appreciated
    Attached Files Attached Files
    Last edited by agarford; 03-18-2013 at 06:23 PM. Reason: missed off attachment

  2. #2
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: VLOOKUP / IF formula - HELP!

    Do you have an example of the setup?

    Edit Post → Go Advanced → scroll down to Manage Attachments

  3. #3
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    Yes, attachment is now added.

  4. #4
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: VLOOKUP / IF formula - HELP!

    Well this isn't as pretty as you would like, I'm sure, but it gets the job done.

    What I did was created a "match-up" table so you can select the team you wish to pair up. (yellow cells)

    Out of the data range that was provided [C2:F297], I created two pivot tables that average the team's scores both at home and away.

    Depending on the teams you select in the "Match-up" their respective average score will appear next to them. This is done with a HLOOKUP from the pivot tables.


    I'm sorry this isn't more elegant. Perhaps someone with more experience will be able to create what you are looking for.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: VLOOKUP / IF formula - HELP!

    I'll try to come up with something that is easier and more elegant. You should prob continue to ask for assistance because you need this for a site, and want it to work as smoothly as possible.

    Perhaps the talented people in the Excel Programming / VBA / Macros Sub-forum.

  6. #6
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    Thanks so much for taking the time to help! Really appreciate it.

    This is perfect to start us off!

    What we would ideally like now, to take us to the next level, is something like this…

    In addition to average goals per game data that you have kindly assisted with, we would like to be able to illustrate each teams ‘previous 5 game goal record’. We would like to show these records next to the team name. So we are looking to develop a formula that will automatically look up the previous 5 game scoring record, for both the home and away teams, from the raw data, and then convert this data to illustrate it using football logos embossed with the score (as shown in the attached word doc).

    Does this sound possible? If so, any help would be greatly appreciated!

    Below is an example of what we envisage… (plus a key)

    AGS 5 4 3 2 `1 Arsenal v Chelsea 1 2 3 4 5 AGS

    AGS = Average Goals Scored (already done)
    1-5 = The goals scored in the past 5 games


    Look forward to hearing from you
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: VLOOKUP / IF formula - HELP!

    Sorry I wasn't able to respond quickly I had a lot going on today at work.

    Thanks to some research and a lot of help from forum member: popipipo in this thread: Find 5 latest dates and return values for each I was able to put this together.

    I hope it is what you are looking for?
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    That’s brilliant. Exactly what we had in mind. I have made a few comments on the attached document – of which are summarised below.

    - We plan to have the top 5 leagues of English football for our users to select from. So we need to apply the same formulas that you have kindly provided for the Premier League for the other 4. I have attached the raw data on new sheets within the attached document, should you be kind enough to assist.

    -When I copy the fixture row down, an error in the AGS column appears. Am not sure why this is.

    -Have added a Premier sheet too (currently blank), so that Premier score data can be transferred onto this tab for ease of maintenance in the future.

    So a few additions/tweaks and we are there.

    Again, we can’t thank you enough for your assistance.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-19-2013
    Location
    Clearwater, FL
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VLOOKUP / IF formula - HELP!

    I haven't had much time to look, but the quick solution to this:
    Quote Originally Posted by agarford View Post
    -When I copy the fixture row down, an error in the AGS column appears. Am not sure why this is.
    The data the HLOOKUP was pulling from was not "locked". Replace the following:

    Cell B6 Old --
    Please Login or Register  to view this content.
    Cell B6 New --
    Please Login or Register  to view this content.
    Cell P6 Old --
    Please Login or Register  to view this content.
    Cell P6 New --
    Please Login or Register  to view this content.

    After you fix those two cells/formulas, you can then copy them down to new rows without issue.

  10. #10
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    Great, thanks for your help.

    Have made the changes you provided (see attached document).

    Now all we require assistance with is setting up formulas like we have for the Premier League, for the other 4 Leagues. Any help would be kindly appreciated.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    08-26-2009
    Location
    Iceland
    MS-Off Ver
    Excel 365, Windows 10
    Posts
    110

    Re: VLOOKUP / IF formula - HELP!

    This look nice, and putting this in one document would be cool.

    Maybe this will make something extra.

    I have bymyself some statistics, but it often quite difficult to make it useful. Where did you get your data so clear?

    Good luck.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    We obtained our data from http://www.football-data.co.uk/

  13. #13
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: VLOOKUP / IF formula. A bit of help required pleased!

    I keep it short (because english is not my native language)
    Look at the yellow cells

    If you need more explanation i will try
    Attached Files Attached Files
    Last edited by popipipo; 03-23-2013 at 05:35 PM.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  14. #14
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula. A bit of help required pleased!

    Thanks for your reply, I am still unsure how to produce the correct formulas for what we need. The attached document has comments on saying what we need help with.

    Again, any help is greatly appreciated.
    Attached Files Attached Files

  15. #15
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: VLOOKUP / IF formula. A bit of help required pleased!

    G'day

    Does this attachment help ?

    The Premiership League on the data tab is working. With drop down menu for the teams and what was the last five games points score from the last round that's been selected. Cell J3 to change the Round played.

    Here is the basics of learning in how to create a drop down menu http://www.contextures.com/xlDataVal01.html
    Attached Files Attached Files
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  16. #16
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: VLOOKUP / IF formula. A bit of help required pleased!

    Howabout this.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula. A bit of help required pleased!

    Brilliant!

    All we need now are a few Pivot Tables, and we are complete! Thankyou so much for your help.

    Please find attached Excel document.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: VLOOKUP / IF formula - HELP!

    Ok agarford, it took some work and time but attached is the spreadsheet you were looking for. I've doubled checked the stats but if you want you can double check them as well.

    I've put instructions for how to add more data on the tabs, basically you will paste it below the current.
    Since you are only concerned with the last season I would suggest pasting over the previous season when you get a chance.
    The current size is .87 MB the more data and formulas added will increase the file size. If this is of no consequence to you then don't worry about it.

    I hope this serves you well. Let me know if you need something else.




    Please provide feedback (Click *, bottom left of the post), if the suggestion helps you!
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    Fett2oo5,

    Brilliant, thats exactly what we had in mind. I have added in rows so that we are able to look up data for all fixtures from all of the leagues. When doing this, there appears to be a slight glitch in the 'Premier' drop down menus. Several blanks appear. Please refer to the attached document.

    Again, we really appreciater your help :-)
    Attached Files Attached Files

  20. #20
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VLOOKUP / IF formula - HELP!

    It has come to our attention you have violated Rule 4 of our Forum RULES. Don't Private Message, Visitor message or email Excel questions to moderators or other members. (Or Access, Word, etc.)

    All questions and answers will benefit other posters like yourself. The point of having a public forum is to share solutions to common (and sometimes uncommon) problems with all members.

    Breaking this rule is considered harrasment by most of our contributors and will not be tolerated. Repeat offense could lead to permanent ban, so do take this caution to heart.

    Post your question in a public thread and our many contributors will come to you to assist, especially if the title is accurate (see Rule #1) and you include a sample desensitized workbook that makes it easy for others to try and help.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  21. #21
    Registered User
    Join Date
    03-18-2013
    Location
    Peterborough, UK
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: VLOOKUP / IF formula - HELP!

    Apologies for the violation. It will not happen again.

    If anyone is able to help with our previous query, we would greatly appreciate it.

    Regards.

  22. #22
    Registered User
    Join Date
    12-17-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: VLOOKUP / IF formula - HELP!

    You are having trouble with the blanks for the data validation dropdown menu because the teams are listed in Column Z. When you are inserting rows you are also inserting blank cells in the list of the teams (because Permiership is at the top you are inserting blank cells in the list of Premiership teams.) On the current spreadsheet you have, highlight Columns Y→AA, right click, click Unhide and you will see what I'm talking about.

    Take a look at this, I've moved the teams below all the tables so you can complete what you are trying to achieve.

    Sorry for the late reply, work has been incredibly busy.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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