calc: index column A with column B

classic Classic list List threaded Threaded
10 messages Options
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

calc: index column A with column B

I want to find the row in column A that corresponds to the row of a value in column B.

eg.

row    A   B

1      10   220000

2      20   150000

3      30   3000

4      40   10

=some_function('A',minimum_function(B));

where minimum_function(B) returns 4 and some_function('A',4) returns the value in column A at row 4.



--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Rob Rob
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

Is this what you mean:

=INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))


> Op 24 jan. 2021, om 23:14 heeft James <[hidden email]> het volgende geschreven:
>
> I want to find the row in column A that corresponds to the row of a value in column B.
>
> eg.
>
> row    A  B
>
> 1      10  220000
>
> 2      20  150000
>
> 3      30  3000
>
> 4      40  10
>
> =some_function('A',minimum_function(B));
>
> where minimum_function(B) returns 4 and some_function('A',4) returns the value in column A at row 4.
>
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

macuser33 macuser33
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

I think you meant to write this:

=INDIRECT("$A"&MATCH(MIN(B*1*:B*4*);B*1*:B*4*;0))


Chuck

On Sun, Jan 24, 2021 at 3:22 PM Rob Jasper <[hidden email]> wrote:

> Is this what you mean:
>
> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
>
>
> > Op 24 jan. 2021, om 23:14 heeft James <[hidden email]> het volgende
> geschreven:
> >
> > I want to find the row in column A that corresponds to the row of a
> value in column B.
> >
> > eg.
> >
> > row    A        B
> >
> > 1      10       220000
> >
> > 2      20       150000
> >
> > 3      30       3000
> >
> > 4      40       10
> >
> > =some_function('A',minimum_function(B));
> >
> > where minimum_function(B) returns 4 and some_function('A',4) returns the
> value in column A at row 4.
> >
> >
> >
> > --
> > To unsubscribe e-mail to: [hidden email]
> > Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> > Posting guidelines + more:
> https://wiki.documentfoundation.org/Netiquette
> > List archive: https://listarchives.libreoffice.org/global/users/
> > Privacy Policy: https://www.documentfoundation.org/privacy
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>
>

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

In reply to this post by Rob
Great, thanks.

On 2021-01-24 5:59 p.m., Rob Jasper wrote:

> Is this what you mean:
>
> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
>
>
>> Op 24 jan. 2021, om 23:14 heeft James <[hidden email]
>> <mailto:[hidden email]>> het volgende geschreven:
>>
>> I want to find the row in column A that corresponds to the row of a
>> value in column B.
>>
>> eg.
>>
>> row    AB
>>
>> 1      10220000
>>
>> 2      20150000
>>
>> 3      303000
>>
>> 4      4010
>>
>> =some_function('A',minimum_function(B));
>>
>> where minimum_function(B) returns 4 and some_function('A',4) returns
>> the value in column A at row 4.
>>
>>
>>
>> --
>> To unsubscribe e-mail to: [hidden email]
>> <mailto:[hidden email]>
>> Problems?
>> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ 
>> <https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/>
>> Posting guidelines + more:
>> https://wiki.documentfoundation.org/Netiquette 
>> <https://wiki.documentfoundation.org/Netiquette>
>> List archive: https://listarchives.libreoffice.org/global/users/ 
>> <https://listarchives.libreoffice.org/global/users/>
>> Privacy Policy: https://www.documentfoundation.org/privacy 
>> <https://www.documentfoundation.org/privacy>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

re: calc: index column A with column B

In reply to this post by bjlockie
>     I want to find the row in column A that corresponds to the row of a
>
> value in column B.
>
>     eg.
>
>     row    A        B
>     1      10       220000
>     2      20       150000
>     3      30       3000
>     4      40       10
>
>     =some_function('A',minimum_function(B));
>
>     where minimum_function(B) returns 4 and some_function('A',4) returns the
>
> value in column A at row 4.
I asked the previous and someone gave me the formula:

=INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))


It worked fine but now I have some rows with zeros (more than one row):
row A B
1       10      220000
2       20      150000
3       30      3000
4       40      10
5 50 0
6 60 0

Is there a MINBUTGREATERTHANZERO function?



--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Rob Rob
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

James,

Since a MINIF function does not exist you can use MINIFS.

Change MIN(B:B) to MINIFS(B:B;B:B;">0”)

Success,
Rob


> Op 29 jan. 2021, om 03:59 heeft James <[hidden email]> het volgende geschreven:
>
>>    I want to find the row in column A that corresponds to the row of a
>>
>> value in column B.
>>
>>    eg.
>>
>>    row    A        B
>>    1      10       220000
>>    2      20       150000
>>    3      30       3000
>>    4      40       10
>>
>>    =some_function('A',minimum_function(B));
>>
>>    where minimum_function(B) returns 4 and some_function('A',4) returns the
>>
>> value in column A at row 4.
> I asked the previous and someone gave me the formula:
>
> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
>
>
> It worked fine but now I have some rows with zeros (more than one row):
> row A B
> 1       10      220000
> 2       20      150000
> 3       30      3000
> 4       40      10
> 5 50 0
> 6 60 0
>
> Is there a MINBUTGREATERTHANZERO function?
>
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

Another problem.

Some of the numbers display as 0 but are calculated so have fractions like

0.0000000812344372353
I want to find the last row that displays as non-zero.
       

On 2021-01-29 6:30 a.m., Rob Jasper wrote

> James,
>
> Since a MINIF function does not exist you can use MINIFS.
>
> Change MIN(B:B) to MINIFS(B:B;B:B;">0”)
>
> Success,
> Rob
>
>
>> Op 29 jan. 2021, om 03:59 heeft James <[hidden email]> het volgende geschreven:
>>
>>>     I want to find the row in column A that corresponds to the row of a
>>>
>>> value in column B.
>>>
>>>     eg.
>>>
>>>     row    A        B
>>>     1      10       220000
>>>     2      20       150000
>>>     3      30       3000
>>>     4      40       10
>>>
>>>     =some_function('A',minimum_function(B));
>>>
>>>     where minimum_function(B) returns 4 and some_function('A',4) returns the
>>>
>>> value in column A at row 4.
>> I asked the previous and someone gave me the formula:
>>
>> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
>>
>>
>> It worked fine but now I have some rows with zeros (more than one row):
>> row A B
>> 1       10      220000
>> 2       20      150000
>> 3       30      3000
>> 4       40      10
>> 5 50 0
>> 6 60 0
>>
>> Is there a MINBUTGREATERTHANZERO function?


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Michael D. Setzer II Michael D. Setzer II
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

Then use >0.0000001 or whatever value works instead of >0


On 29 Jan 2021 at 14:06, James wrote:

Subject:         Re: [libreoffice-users] calc: index column A with
column B
To:             Rob Jasper <[hidden email]>
Copies to:       [hidden email]
From:           James <[hidden email]>
Date sent:       Fri, 29 Jan 2021 14:06:08 -0500

> Another problem.
>
> Some of the numbers display as 0 but are calculated so have fractions like
>
> 0.0000000812344372353
> I want to find the last row that displays as non-zero.
>
>
> On 2021-01-29 6:30 a.m., Rob Jasper wrote
>
> > James,
> >
> > Since a MINIF function does not exist you can use MINIFS.
> >
> > Change MIN(B:B) to MINIFS(B:B;B:B;">0")
> >
> > Success,
> > Rob
> >
> >
> >> Op 29 jan. 2021, om 03:59 heeft James <[hidden email]> het volgende geschreven:
> >>
> >>>     I want to find the row in column A that corresponds to the row of a
> >>>
> >>> value in column B.
> >>>
> >>>     eg.
> >>>
> >>>     row    A        B
> >>>     1      10       220000
> >>>     2      20       150000
> >>>     3      30       3000
> >>>     4      40       10
> >>>
> >>>     =some_function('A',minimum_function(B));
> >>>
> >>>     where minimum_function(B) returns 4 and some_function('A',4) returns the
> >>>
> >>> value in column A at row 4.
> >> I asked the previous and someone gave me the formula:
> >>
> >> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
> >>
> >>
> >> It worked fine but now I have some rows with zeros (more than one row):
> >> row A B
> >> 1       10      220000
> >> 2       20      150000
> >> 3       30      3000
> >> 4       40      10
> >> 5 50 0
> >> 6 60 0
> >>
> >> Is there a MINBUTGREATERTHANZERO function?
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy


+------------------------------------------------------------+
 Michael D. Setzer II - Computer Science Instructor (Retired)    
 mailto:[hidden email]                            
 mailto:[hidden email]
 Guam - Where America's Day Begins                        
 G4L Disk Imaging Project maintainer
 http://sourceforge.net/projects/g4l/
+------------------------------------------------------------+




--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Johnny Rosenberg Johnny Rosenberg
Reply | Threaded
Open this post in threaded view
|

Re: calc: index column A with column B

In reply to this post by bjlockie
Den fre 29 jan. 2021 kl 20:16 skrev James <[hidden email]>:

> Another problem.
>
> Some of the numbers display as 0 but are calculated so have fractions like
>
> 0.0000000812344372353
> I want to find the last row that displays as non-zero.
>

One way to solve it is to round all involved cell values, if all the extra
decimals are not necessary. Depending on what your formulas look like, you
can probably wrap an ROUND() around each one of them. For instance
=ROUND(MyBigAndComplicatedFormula;5)

There's also a (global) setting to make all cell values exactly as they are
viewed, but that would affect all your spreadsheets, I guess. In many cases
you probably don't want that.


Kind regards

Johnny Rosenberg


>
>
> On 2021-01-29 6:30 a.m., Rob Jasper wrote
>
> > James,
> >
> > Since a MINIF function does not exist you can use MINIFS.
> >
> > Change MIN(B:B) to MINIFS(B:B;B:B;">0”)
> >
> > Success,
> > Rob
> >
> >
> >> Op 29 jan. 2021, om 03:59 heeft James <[hidden email]> het
> volgende geschreven:
> >>
> >>>     I want to find the row in column A that corresponds to the row of a
> >>>
> >>> value in column B.
> >>>
> >>>     eg.
> >>>
> >>>     row    A        B
> >>>     1      10       220000
> >>>     2      20       150000
> >>>     3      30       3000
> >>>     4      40       10
> >>>
> >>>     =some_function('A',minimum_function(B));
> >>>
> >>>     where minimum_function(B) returns 4 and some_function('A',4)
> returns the
> >>>
> >>> value in column A at row 4.
> >> I asked the previous and someone gave me the formula:
> >>
> >> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
> >>
> >>
> >> It worked fine but now I have some rows with zeros (more than one row):
> >> row  A       B
> >> 1       10      220000
> >> 2       20      150000
> >> 3       30      3000
> >> 4       40      10
> >> 5    50      0
> >> 6    60      0
> >>
> >> Is there a MINBUTGREATERTHANZERO function?
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Rob Rob
Reply | Threaded
Open this post in threaded view
|

Re: [BULK] Re: [libreoffice-users] calc: index column A with column B

In reply to this post by bjlockie
James,
There are 2 basic ways to accomplish this:

Round the values at calculation time, so they’ll become real 0’s

Change the formula to MINIFS(B:B;B:B;">=1”)

Success,
Rob

> Op 29 jan. 2021, om 20:06 heeft James <[hidden email]> het volgende geschreven:
>
> Another problem.
>
> Some of the numbers display as 0 but are calculated so have fractions like
> 0.0000000812344372353
> I want to find the last row that displays as non-zero.
>
>
> On 2021-01-29 6:30 a.m., Rob Jasper wrote
>> James,
>>
>> Since a MINIF function does not exist you can use MINIFS.
>>
>> Change MIN(B:B) to MINIFS(B:B;B:B;">0”)
>>
>> Success,
>> Rob
>>
>>
>>> Op 29 jan. 2021, om 03:59 heeft James <[hidden email]> <mailto:[hidden email]> het volgende geschreven:
>>>
>>>>    I want to find the row in column A that corresponds to the row of a
>>>>
>>>> value in column B.
>>>>
>>>>    eg.
>>>>
>>>>    row    A        B
>>>>    1      10       220000
>>>>    2      20       150000
>>>>    3      30       3000
>>>>    4      40       10
>>>>
>>>>    =some_function('A',minimum_function(B));
>>>>
>>>>    where minimum_function(B) returns 4 and some_function('A',4) returns the
>>>>
>>>> value in column A at row 4.
>>> I asked the previous and someone gave me the formula:
>>>
>>> =INDIRECT("$A"&MATCH(MIN(B:B);B:B;0))
>>>
>>>
>>> It worked fine but now I have some rows with zeros (more than one row):
>>> row A B
>>> 1       10      220000
>>> 2       20      150000
>>> 3       30      3000
>>> 4       40      10
>>> 5 50 0
>>> 6 60 0
>>>
>>> Is there a MINBUTGREATERTHANZERO function?


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy