+ Reply to Thread
Results 1 to 10 of 10

Comparing multiple columns by occurrences of text using IF and LARGE

Hybrid View

  1. #1
    Registered User
    Join Date
    03-16-2015
    Location
    Stockholm
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    6

    Comparing multiple columns by occurrences of text using IF and LARGE

    This is in Power Pivot and I am as you may see, a novice when it comes to writing functions.

    The columns I am trying to use in the formula are MARKET, BRAND POSITION, ShowAllCost as well as Newcolumn.

    I want to compare all ShowAllCost in a certain MARKET and change all BRAND POSITION attached to that MARKET except for the seven highest ShowAllCost in a certain MARKET to "Others" in NewColumn.

    This is my start:
    Formula: copy to clipboard
    =IF(AND([MARKET]=Bubblegum)((LARGE([ShowAllCost];7))(NewColumn;"Others")


    The best outcome would be that I wouldn't have to make more than one formula to scan all the different names in MARKET when looking for BRAND POSITIONs to call "Others" in NewColumn.

    What am I doing wrong and what should I write?

    Thanks!
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    Could you post a sample workbook for us to look at? Although posting images is easy, nobody likes recreating data to test possible solutions on
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Registered User
    Join Date
    03-16-2015
    Location
    Stockholm
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    6

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    Thanks for the swift reply! Here's the file:

    ExampleSorting.xlsx

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    I'm not sure if I'm missing something, but I'm not seeing a NewColumn heading, either in your attached image or your example file. Along with this, what do you mean by you want to "change all BRAND POSITION attached to that MARKET?" Changing data needs to be done manually, if not then by some VBA. The easiest manual way would be through filtering.

  5. #5
    Registered User
    Join Date
    03-16-2015
    Location
    Stockholm
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    6

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    What I meant to say is that I want those with 8 or below in ShowAllCost value don't get their BRAND POSITION written, but instead it will say "Others" in the NewColumn. NewColumn is just Column that needs to hold the values from BRAND POSITION, both the new "Others" as well as their original BRAND POSITION if their value is 7 or above in ShowAllCost for a specific MARKET.

  6. #6
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    I took a stab at what you may be after anyways. See attached; the green cell in I2 is where you input the Market you are looking for, and your results are in columns K:P.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    Your statement just seemed to contradict itself.

    For clarity, this is what you want:

    A new column (column F) that will check column E, and return "Other" if the value in column E is less than or equal to 8; otherwise, return the corresponding value in Brand Position.

    What is throwing me for a loop is where you mention the value of 7 or above...that would conflict with your previous statement.

  8. #8
    Registered User
    Join Date
    03-16-2015
    Location
    Stockholm
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    6

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    Ohh sorry, trying to explainstuff isn't my strongest point I'm afraid. The the seven highest numbers in each market are supposed to keep their names.

    At the moment I am trying to go around this issue by making a sheet that first goes through each market and checks the seventh highest number using large and then using an if-statement to determine the seven highest numbers, the rest get renamed to Others.

  9. #9
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    I think this makes more sense now. The best way to do this without over complicating things would be to add a helper column (which you can hide). See attached for possible solution. Column G returns the top 7 values in column E, based on their ordinal position in column A.

    If this isn't what you hoped in terms of a solution, please re upload a sample workbook, but include how you would want your data to look.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-16-2015
    Location
    Stockholm
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    6

    Re: Comparing multiple columns by occurrences of text using IF and LARGE

    Thanks that's exactly what I needed!

    I also had some success by using LARGE to determine the seventh highest number and through each market separately in order to rename some brand positions to "Others" and then adding them to the data model that I have.

    But yeah, thanks a lot for the help your way was more smooth than mine!

+ 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] AVERAGEIF Multiple Columns Multiple occurrences
    By jeroenft in forum Excel General
    Replies: 4
    Last Post: 02-03-2015, 04:58 PM
  2. Table/function that counts number of occurrences within multiple columns
    By Superion in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2013, 06:38 PM
  3. Replies: 4
    Last Post: 07-20-2011, 09:20 AM
  4. Counting Multiple Occurrences of Text in a Cell
    By bentleybob in forum Excel General
    Replies: 5
    Last Post: 05-02-2011, 01:44 PM
  5. Counting Occurrences of Data in Multiple Columns
    By jgray in forum Excel General
    Replies: 3
    Last Post: 12-13-2010, 03:44 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