Bug 155424 - LISTIF function
Summary: LISTIF function
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2023-05-20 18:52 UTC by Liam M
Modified: 2023-05-22 09:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liam M 2023-05-20 18:52:34 UTC
Description:
I propose a new function called "LISTIF" for Libreoffice Calc. This function finds the nth value in a range that meets the stated criterion.

It would have the following arguments:
Range: The range to be evaluated by the criteria given.
Criteria: The criterion to be applied to the range.
Number: The nth value that meets the criterion will be displayed.
List range (optional): The range from which outputs will be drawn.

If the "number" argument is set to "1", then this function will output the first value in the range that meets the criteria. If set to "2", it will output the second.

Actual Results:
 

Expected Results:
 


Reproducible: Always


User Profile Reset: No

Additional Info:
Comment 1 m_a_riosv 2023-05-20 23:35:00 UTC
You can do it easily with AGGREGATE function, or with LARGE as array.
1	8	=AGGREGATE(14;4;A:A*(A:A<15);2)
2		
3	8	{=LARGE(A:A*(A:A<15);2)}
4	
5		
6		
1		
3		
5		
17		
21		
4		
8		
12			

AGGREGATE help :https://help.libreoffice.org/7.6/en-US/text/scalc/01/func_aggregate.html?DbPAR=CALC#bm_id126123001625791
LARGE help https://help.libreoffice.org/7.6/en-US/text/scalc/01/04060183.html?DbPAR=CALC#bm_id3149530

Being possible to get it only with one function, I don't think will be easy to get it developed.
Comment 2 Xisco Faulí 2023-05-22 09:48:10 UTC
@Winfried, @Eike, any opinion on this ?