or Explore Discussions

# How do I do a min/max output based upon a specific criteria?

10/29/21
Accepted

So I think I've come close to this in the area of indexing, matching, etc., but I can't quite get the formula to work the correct way.

I have a sheet setup to where it calculates the average number of days that specific jobs have been open and working within several different groups in my organization. Each organization has a different 3 letter identifier. What I want to do is, on a different sheet, just have two different lookups for each organization that identifies the smallest number of days, and the largest number of days, that each jobs has been open, based upon their organizational code, without having to highlight the ranges manually (but instead use the columns) since we add rows quite frequently.

I've included a picture of the type of data I'm working with, and the type of out put I'm trying to come up with, if it's possible to do so cross sheets.

I can get as far as this lookup

=INDEX({FY22 Hiring Tracker Range 2}, MATCH(MAX({FY22 Hiring Tracker Range 2}), {FY22 Hiring Tracker Range 2}))

which outputs the highest number in the days open column, but I cannot figure out how to make it reference the org code column for the life of me.

Any help would be greatly appreciated, idk if I'm just over thinking this.

Tags:

• I'm not sure if I'm understanding it right, but if you want a formula for finding MIN and MAX for this

Here is the formula:

=MIN(COLLECT({Days Open},{Org Code},Parent([email protected])))

=MAX(COLLECT({Days Open},{Org Code},Parent([email protected])))

Collect({cross sheet reference to days open column},{cross sheet reference to org code column}, Parent(the @row parent with 3 letter identifier))

Hope this helps.

Have a nice weekend.

• I'm not sure if I'm understanding it right, but if you want a formula for finding MIN and MAX for this

Here is the formula:

=MIN(COLLECT({Days Open},{Org Code},Parent([email protected])))

=MAX(COLLECT({Days Open},{Org Code},Parent([email protected])))

Collect({cross sheet reference to days open column},{cross sheet reference to org code column}, Parent(the @row parent with 3 letter identifier))

Hope this helps.

Have a nice weekend.

• Thanks so much for getting me to my solution! Weirdly enough when I removed the 'Parent([email protected])' bit and replaced it with the name of the org, it finally worked. My final formula was

=Max(Collect({Days Open}, {Org Code}, "3 letter org"))

and it finally worked. Thanks so much for getting me to the correct =formula set!
{"ft_lang_label":"__label__en","ft_lang_prob":0.8812382,"math_prob":0.7377928,"size":2570,"snap":"2022-05-2022-21","text_gpt3_token_len":599,"char_repetition_ratio":0.09625877,"word_repetition_ratio":0.29256594,"special_character_ratio":0.23501946,"punctuation_ratio":0.102564104,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9653177,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-24T18:29:19Z\",\"WARC-Record-ID\":\"<urn:uuid:b8599348-9cb9-47b3-ae40-75158035d382>\",\"Content-Length\":\"119557\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7e56a02c-99d7-4333-89cd-719e138c9c77>\",\"WARC-Concurrent-To\":\"<urn:uuid:0e9bdf03-971c-4926-8252-b572f3bd4142>\",\"WARC-IP-Address\":\"162.159.128.79\",\"WARC-Target-URI\":\"https://community.smartsheet.com/discussion/84535/how-do-i-do-a-min-max-output-based-upon-a-specific-criteria\",\"WARC-Payload-Digest\":\"sha1:LH2JE3EU2JGR4U4SBOV5MQCAARRYJ6QK\",\"WARC-Block-Digest\":\"sha1:IDEWVD6OUQLWZ7OUSMNB4RXBDEEKLR6E\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662573189.78_warc_CC-MAIN-20220524173011-20220524203011-00558.warc.gz\"}"}