+ Reply to Thread
Results 1 to 10 of 10

Formula to display cell based on multiple critera

  1. #1
    Registered User
    Join Date
    04-05-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Formula to display cell based on multiple critera

    Hi,

    Hoping someone can help me create a formula to solve a problem I am having.

    I have an output dump of data which is in a format similar to below. Column A has the "site" ID which can appear multiple times. Column B is a subheading (only interested in lines with "Issue" and Column C has the "Issue".

    Site Description Issue
    1111 Data
    1111 Issue Issue A
    1111 Issue Issue B
    2222 Issue Issue C
    2222 Issue Issue D
    2222 Data

    On a second sheet, I want to create another spreadsheet which sorts this data into one line per site. I want it so there will be Column A - Site Number, Column B - Issue 1, Column B, Issue 2.

    Site Issue 1 Issue 2
    1111 Issue A Issue B
    2222 Issue C Issue D


    I've attached an example spreadsheet with what I am trying to do. The "Summary" sheet I am trying to find a formula to use in the orange cells (B2-C4) which will list all the issues.

    Thanks for any assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula to display cell based on multiple critera

    Hi,

    In B2 to be copied across

    Please Login or Register  to view this content.
    Do you need to list the sites in column A of sheet "summary"?
    Last edited by canapone; 04-05-2017 at 02:52 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Formula to display cell based on multiple critera

    Hi
    this macro should do it. It assumes the following named ranges:
    • "sites" = the range on the data sheet containing the site list (A2:A7 on your current sheet)
    • "issues" = the range on the data sheet containing the issues (C2:C7 on your current sheet)
    • "sitelist" = the range on the summary sheet containing the names of all sites (A2:A3 on your current sheet)

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula to display cell based on multiple critera

    Hi Again

    in A2 to be copied below

    Please Login or Register  to view this content.
    Please refer to the attachment.

    --------------

    Regards
    Attached Files Attached Files
    Last edited by canapone; 04-05-2017 at 02:52 AM. Reason: [code]

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

    Re: Formula to display cell based on multiple critera

    Quote Originally Posted by NickyC View Post
    Hi
    this macro should do it.
    Please note that the OP has asked for a formula solution.
    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
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Formula to display cell based on multiple critera

    oops - so they did
    looks like canapone's answer fits the bill

  7. #7
    Registered User
    Join Date
    04-05-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula to display cell based on multiple critera

    Thanks Canapone. That formula does the trick - I haven't seen the aggregrate command before - something new to learn. Thanks again

  8. #8
    Registered User
    Join Date
    04-05-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula to display cell based on multiple critera

    Just realised I need to add another level of complexity to the equation. A Site number may have multiple visit dates, so I will have multiple columns for Issues on Visit 1 and Issues for Visit 2 etc.
    Is there a way to amend the formula to put any issues with Site "A" and date "x" under visit 1 issues, Site "A" and "Date y" under Visit 2 issues etc?

    Data Dump:
    Site Date Description Issue
    1111 1/01/2017 Data
    1111 1/01/2017 Issue Issue A
    1111 1/01/2017 Issue Issue B
    1111 2/02/2017 Issue Issue C
    2222 1/01/2017 Issue Issue WW
    2222 2/02/2017 Issue Issue XX
    2222 2/02/2017 Data


    Example.JPG
    Thanks in advance.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Formula to display cell based on multiple critera

    Hi,

    you could use an helper row (Row1) to split dates

    in B1

    =AGGREGATE(15,6,Data!$B$2:$B$100/(Data!$B$2:$B$100>MAX($A1:A1)),1)


    In B3 to be copied across, the new INDEX exploits information in row 1

    =IFERROR(INDEX(Data!$D$1:$D$1000,AGGREGATE(15,6,ROW($1:$992)/((Data!$D$1:$D$1000<>"")*(Data!$A$1:$A$1000=$A3)*(Data!$B$1:$B$1000=MAX($B$1:B$1))),RIGHT(B$2))),"")


    There for sure better approaches
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-05-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula to display cell based on multiple critera

    Thanks Canapone. I was on the same thought pattern and had already added extra columns with the visit date - just couldn't get the formula working with it. Your one works great. Thank you again!

+ 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] Sumproduct formula based on 3 critera
    By toci in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-25-2016, 05:46 AM
  2. IF formula based upon multiple conditions to display text in one cell
    By jono7gold in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-07-2014, 10:29 AM
  3. Formula for counting 2 different critera in multiple columns
    By Lucy_P in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2014, 05:18 PM
  4. [SOLVED] Sum Formula based on single or multiple critera that sums accross and array
    By Dial1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2013, 07:14 PM
  5. Formula to allcoate values based on multiple critera
    By rpjohnson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2012, 06:33 PM
  6. Pasting multiple sheets in to a workbook based on critera matching file name
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-24-2009, 05:50 PM
  7. [SOLVED] help with sumif formula with multiple critera
    By Matt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2006, 02:00 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