+ Reply to Thread
Results 1 to 8 of 8

Difficulty with fetching data from string with if functions

  1. #1
    Registered User
    Join Date
    12-02-2014
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    4

    Difficulty with fetching data from string with if functions

    My data looks like this:

    ("Albums" sheet)
    Picture 1.png

    ("Sheet 2" sheet)
    Picture 2.png

    These are my codes:
    =COUNTIF(Albums!AF:AF,"*"&A2&"*")

    =AVERAGEIF(Albums!AF:AF,"*"&A2&"*",Albums!L:L)

    The problem is that they don't compute "jazz" the way I want them to. I want to count and average *only* those albums that are specified as jazz, not the jazz fusion ones. I've tried and tried but haven't found any solution. Any suggestions?

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Difficulty with fetching data from string with if functions

    So images are not the best way to go (Currently unable to see them)

    Mind posting a sampling of your data and I or someone else here will be able to better assist in locating a solution for with you.
    -If you think you are done, Start over - ELeGault

  3. #3
    Registered User
    Join Date
    12-02-2014
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    4

    Re: Difficulty with fetching data from string with if functions

    Not sure about the formatting, but:

    Column A, Sheet "Albums"

    Album
    A Love Supreme
    Kind of Blue
    あらためまして、はじめまして、ミドリです。
    Aghora

    Column AF, Sheet "Albums"

    Genre
    Jazz
    Jazz
    Jazz fusion
    Progressive metal, jazz fusion

    Sheet 2

    Genre Count Average
    Jazz 4 3,93
    Jazz fusion 2 3,52
    Progressive metal 1 3,47

  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,938

    Re: Difficulty with fetching data from string with if functions

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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
    Registered User
    Join Date
    12-02-2014
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    4

    Re: Difficulty with fetching data from string with if functions

    Here it is

    Example.xlsx

  6. #6
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Difficulty with fetching data from string with if functions

    I see - it would require knowing your data intimately. When using wildcards and having a variable char count or variations that are that close you will need to subtract out any that have the core within the other. It Cannot be (To my knowledge) be a single formula fits all in this case.

    Than for your average base it on the results of counts, don't reapply the wildcard formula as to avoid further inflation of any counts.

  7. #7
    Registered User
    Join Date
    12-02-2014
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    4

    Re: Difficulty with fetching data from string with if functions

    Quote Originally Posted by ELeGault View Post
    I see - it would require knowing your data intimately. When using wildcards and having a variable char count or variations that are that close you will need to subtract out any that have the core within the other. It Cannot be (To my knowledge) be a single formula fits all in this case.

    Than for your average base it on the results of counts, don't reapply the wildcard formula as to avoid further inflation of any counts.
    I hadn't though of that. Tunnel vision, I guess.

    It's actually a pretty decent solution - a huge improvement on what I'm working with now. Thank you very much - it's greatly appreciated.

  8. #8
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Difficulty with fetching data from string with if functions

    One of those, sometimes the simplest solution is the right one -

    If you are good with this - Don't forget to set the thread to SOLVED - Under thread tools-

    Have a good one -

+ 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] Difficulty getting monetry value in 2DP within a text string
    By Deventus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2013, 08:36 AM
  2. Difficulty with macros and if functions
    By Reverdi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 12:16 PM
  3. I have had difficulty in creating user defined functions in Excel
    By DerbyJim1978 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 07:05 AM
  4. I have had difficulty in creating user defined functions in Excel
    By MichaelG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. [SOLVED] I have had difficulty in creating user defined functions in Excel
    By MichaelG in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-13-2005, 07:05 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