如何使用 LibreOffice Calc 'set' 数据类型 [英] How to use LibreOffice Calc 'set' datatype

查看:49
本文介绍了如何使用 LibreOffice Calc 'set' 数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个这样的电子表格:a1=3, b1=(1..10,15)
如何检查 a1 是否在 b1 中?```=if (a1 in b1, 'tada!', 'Missed it')``?这是正确的吗?

解决方案

好的,试试

传递给函数的数字列表必须是正整数集.- + = 或 _ 分隔的数字表示值的区间,其他非数字字符(包括句点、逗号、空格)被视为分隔数字的分隔符.因此,您示例中的 1..10,15 将转换为 1, 10, 15,使用符号 -

一些示例将帮助您了解各个函数的用途.最后一行是您问题的答案.

已更新.从 Basic 开始,所有这些函数都像嵌入式 Calc 函数一样调用,带有服务 FunctionAccess

函数 IsOnPeak(C2 As Variant, I13 As String, D2 As Variant, I16 As String) As Boolean将 Mth 调暗为整数Dim hr 作为整数Dim svFA 作为变体月 = 月 (C2)小时 = 小时(D2)svFA = createUnoService(com.sun.star.sheet.FunctionAccess")IsOnPeak = (svFA.callFunction(LSTOR",Array(Mth,I13)) <> ") And (svFA.callFunction(LSTOR",Array(Hr, I16)) <>《》)结束函数

I have a spreadsheet like this: a1=3, b1=(1..10,15)
How do I check if a1 is in b1? ```=if (a1 in b1, 'tada!', 'Missed it')``? Is this correct?

解决方案

Ok, try this extension. (This was written many years ago to record numbers on insurance policy forms.)

The extension contains several functions, the name of each of which begins with LST, in the Function Wizard they are located in the Add-In section.

The lists of numbers that are passed to the function must be sets of positive integers. Numbers separated by - + = or _ signify an interval of values, other non-digit characters (including period, comma, space) are regarded as separators of separate numbers. Therefore 1..10,15 from your example will be converted to 1, 10, 15, use the sign -

A few examples will help you understand the purpose of the individual functions. The last line is the answer to your question.

Updated. From Basic all this functions calling like as embedded Calc functions, with service FunctionAccess

Function IsOnPeak(C2 As Variant, I13 As String, D2  As Variant, I16 As String) As Boolean 
Dim Mth As Integer 
Dim hr As Integer  
Dim svFA As Variant
    Mth =Month(C2)    
    hr = HOUR(D2) 
    svFA = createUnoService( "com.sun.star.sheet.FunctionAccess" )
    IsOnPeak = (svFA.callFunction("LSTOR",Array(Mth,I13)) <> "") And (svFA.callFunction("LSTOR",Array(Hr, I16)) <> "")
End Function

这篇关于如何使用 LibreOffice Calc 'set' 数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆