+ Reply to Thread
Results 1 to 15 of 15

Need a formula to return the value in the Address column if 3 other criteria are met...

  1. #1
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Need a formula to return the value in the Address column if 3 other criteria are met...

    See the attached Sample Worksheet.

    I am looking for a formula that will return the value in the Address Column if the State column is "AL", the Activity Column is "Available", and the Days_In_Activity Column is >90.

    I also need it to not repeat values previously returned.

    Thanks for the help everyone.
    Attached Files Attached Files
    Last edited by Stanimal; 12-29-2014 at 10:42 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    Hi Stanimal, I have 2 sheets in my example.
    Sheet 1 displays the address next to the existing line if it matches the criteria.
    Sheet 2 uses 2 helper columns to make a list of all addresses that meet the criteria starting at row2

    Both sheets will look at the first 1000 addresses (any more than that and you'll need to copy formulas down)
    They don't look for duplicates yet. Will have a look at that after a long sleep if no-one has fixed it first
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    Hey Beamer,

    Thanks for the help on this. I actually have one page that is the evaluation page with the formulas and another page with the data so they will not correlate.

    I need to be able to evaluate the entire column or at least B1:B10,000 and then be able to paste the formula down Column A of Worksheet B for instance and have it return all the addresses that meet the criterion without repeating any of the applicable addresses.

    Let me know if you have something for that.

    Thanks,

    stan

  4. #4
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    The version I did on Sheet2 would work with some small changes (as in the example I attach here now), but you would still need to insert a helper column at the start of your data page. If you can do that then this will work fine.
    If you can't add a helper column then maybe an array might work (not sure though), but I haven't got around to learning how they work yet.
    This still doesn't sort out duplicates, that's my next step, will the duplicate address also have the same ID?
    And one other thing, do you ever want to change your search criteria ("AL","Available",>90)?

    Oh btw, I made the evaluation sheet import all of the data for each match. You can just delete the columns you don't want.
    Attached Files Attached Files

  5. #5
    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
    53,050

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    Not sure where you want to put this, but this ARRAY formula will give you what you want...
    =IFERROR(INDEX($B$2:$B$8,SMALL(IF(($D$2:$D$8="AL")*($G$2:$G$8="Available")*($H$2:$H$8>90),ROW($A$2:$A$8)-1),ROWS($A$1:A1))),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    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

  6. #6
    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
    53,050

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    I just noticed that you have 10 000 rows, my ARRAY formula may slow things down with that many rows. If it does, try this option...

    create a helper column in that data table (I used I), and copy this down...
    =IF(AND(D2="AL",G2="Available",H2>90),I1+1,I1)

    Then use this to extract the data you want...
    =IFERROR(INDEX(B:B,MATCH(ROW(A1),I:I,0)),"")

  7. #7
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    Thank you beamer for the effort.

  8. #8
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    FDibbins,

    I cannot use a helper column because I am turning this over to a different department and they are only able to add data to the data sheet but will not be managing the helper column.

    I used your first formula which appeared to be working in the actual worksheet until I reordered the data and then all the returned addresses changed completely.

    Do you have any thoughts?

    Thanks for the help.

  9. #9
    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
    53,050

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    The helper does not need managing and can, in fact, be hidden.

    Also, sorting should not affect that, as long as you dont include it in the sort range

  10. #10
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    It would need to be copied down as the column increases. We buy 300-400 new properties/mo so we will need to keep adding to the list.

    Also, when I used it on a 4,000 address worksheet, the formula returned completely different addresses - that didn't meet the "IF" Criteria.

    Let me know if u have additional ideas. Thx

  11. #11
    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
    53,050

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    OK, can you show me a file with more than just 2-3 examples in it? And also, how it messes when sorted

    The formula in the helper is really simple and will take up almost no resources

  12. #12
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    Hi again, I just wanted to see if I could make my way work out...ended up changing things a bit, but I believe it does what you need, although it might be a little slow.

    Was really easy to get a list with repeats in it, but in order to remove repeated addresses I had to duplicate my list of matches.

    This does not affect the data sheet at all, only looks at it.
    It looks at the first 10,000 lines in the data sheet and creates a 1,000 line output in the evaluation sheet.

    Sorry about the .zip but it was over the forums size limit.

    You can sort the data sheet any way you wish but if you are trying to sort the results, I think you'll need a vba macro to copy the results to a new area, maybe into a pivot table even.
    Attached Files Attached Files
    Last edited by Beamernsw; 12-31-2014 at 12:50 AM.

  13. #13
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    FDibbins,

    Alright, I have attached a sample file with 1,000 records. This is actual data, but without some of the additional columns we are using.

    Sheet 1 contains your formula with the data sorted so that the matches appear at the top. Sheet 2 was resorted and the evaluation column went blank. Same thing happened on Sheet 3 when I sorted by different criteria.

    In the past it was doing something different but I was unable to duplicate it.

    Additionally, I would like to return additional data from the same line in adjacent columns, but I think we need to get this squared first.

    Please advise.

    Thanks,

    Stan
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    Beamer,

    I appreciate the additional effort, I can tell it took some time. Unfortunately, I cannot have helper columns on the same sheet or on the data page. They will not allow it.

    Let me know if you have any additional thoughts.

    Thank you again for the help.

    Chat soon

  15. #15
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Need a formula to return the value in the Address column if 3 other criteria are met..

    As I said before, my last version only looks at the data page(makes no changes to it at all), there is no helper column on the data sheet, and it brings over all the info on that line which you'll be able to change to whatever columns you need yourself very easily.
    If you need to sort the results, just sort the data page and the results will appear sorted the same way.
    Last edited by Beamernsw; 01-04-2015 at 08:12 PM.

+ 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] How to return address of the column or cell I select, not just return the value?
    By qzqzjcjp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-18-2014, 04:57 PM
  2. Replies: 4
    Last Post: 01-12-2014, 11:52 PM
  3. Replies: 3
    Last Post: 07-27-2011, 02:29 PM
  4. Return range address by criteria
    By ScottStevo in forum Excel General
    Replies: 6
    Last Post: 05-12-2011, 10:38 AM
  5. [SOLVED] Formula to return ADDRESS of cell in range that meets criteria
    By Christie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2005, 08:06 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