Package ch.rabanti.picoxlsx4j
Class BasicFormulas
- java.lang.Object
-
- ch.rabanti.picoxlsx4j.BasicFormulas
-
public final class BasicFormulas extends Object
Class for handling of basic Excel formulas- Author:
- Raphael Stoeckli
-
-
Constructor Summary
Constructors Constructor Description BasicFormulas()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Cell
Average(Range range)
Returns a cell with a average formulastatic Cell
Average(Worksheet target, Range range)
Returns a cell with a average formulastatic Cell
Ceil(Address address, int decimals)
Returns a cell with a ceil formulastatic Cell
Ceil(Worksheet target, Address address, int decimals)
Returns a cell with a ceil formulastatic Cell
Floor(Address address, int decimals)
Returns a cell with a floor formulastatic Cell
Floor(Worksheet target, Address address, int decimals)
Returns a cell with a floor formulastatic Cell
Max(Range range)
Returns a cell with a max formulastatic Cell
Max(Worksheet target, Range range)
Returns a cell with a max formulastatic Cell
Median(Range range)
Returns a cell with a median formulastatic Cell
Median(Worksheet target, Range range)
Returns a cell with a median formulastatic Cell
Min(Range range)
Returns a cell with a min formulastatic Cell
Min(Worksheet target, Range range)
Returns a cell with a min formulastatic Cell
Round(Address address, int decimals)
Returns a cell with a round formulastatic Cell
Round(Worksheet target, Address address, int decimals)
Returns a cell with a round formulastatic Cell
Sum(Range range)
Returns a cell with a sum formulastatic Cell
Sum(Worksheet target, Range range)
Returns a cell with a sum formulastatic Cell
VLookup(Address address, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel functionstatic Cell
VLookup(Worksheet queryTarget, Address address, Worksheet rangeTarget, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel functionstatic Cell
VLookup(Object number, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel functionstatic Cell
VLookup(Object number, Worksheet rangeTarget, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel function
-
-
-
Method Detail
-
Average
public static Cell Average(Range range)
Returns a cell with a average formula- Parameters:
range
- Cell range to apply the average operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Average
public static Cell Average(Worksheet target, Range range)
Returns a cell with a average formula- Parameters:
target
- Target worksheet of the average operation. Can be null if on the same worksheetrange
- Cell range to apply the average operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Ceil
public static Cell Ceil(Address address, int decimals)
Returns a cell with a ceil formula- Parameters:
address
- Address to apply the ceil operation todecimals
- Number of decimals (digits)- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Ceil
public static Cell Ceil(Worksheet target, Address address, int decimals)
Returns a cell with a ceil formula- Parameters:
target
- Target worksheet of the ceil operation. Can be null if on the same worksheetaddress
- Address to apply the ceil operation todecimals
- Number of decimals (digits)- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Floor
public static Cell Floor(Address address, int decimals)
Returns a cell with a floor formula- Parameters:
address
- Address to apply the floor operation todecimals
- Number of decimals (digits)- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Floor
public static Cell Floor(Worksheet target, Address address, int decimals)
Returns a cell with a floor formula- Parameters:
target
- Target worksheet of the floor operation. Can be null if on the same worksheetaddress
- Address to apply the floor operation todecimals
- Number of decimals (digits)- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Max
public static Cell Max(Range range)
Returns a cell with a max formula- Parameters:
range
- Cell range to apply the max operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Max
public static Cell Max(Worksheet target, Range range)
Returns a cell with a max formula- Parameters:
target
- Target worksheet of the max operation. Can be null if on the same worksheetrange
- Cell range to apply the max operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Median
public static Cell Median(Range range)
Returns a cell with a median formula- Parameters:
range
- Cell range to apply the median operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Median
public static Cell Median(Worksheet target, Range range)
Returns a cell with a median formula- Parameters:
target
- Target worksheet of the median operation. Can be null if on the same worksheetrange
- Cell range to apply the median operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Min
public static Cell Min(Range range)
Returns a cell with a min formula- Parameters:
range
- Cell range to apply the min operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Min
public static Cell Min(Worksheet target, Range range)
Returns a cell with a min formula- Parameters:
target
- Target worksheet of the min operation. Can be null if on the same worksheetrange
- Cell range to apply the median operation to- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Round
public static Cell Round(Address address, int decimals)
Returns a cell with a round formula- Parameters:
address
- Address to apply the round operation todecimals
- Number of decimals (digits)- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Round
public static Cell Round(Worksheet target, Address address, int decimals)
Returns a cell with a round formula- Parameters:
target
- Target worksheet of the round operation. Can be null if on the same worksheetaddress
- Address to apply the round operation todecimals
- Number of decimals (digits)- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Sum
public static Cell Sum(Range range)
Returns a cell with a sum formula- Parameters:
range
- Cell range to get a sum of- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
Sum
public static Cell Sum(Worksheet target, Range range)
Returns a cell with a sum formula- Parameters:
target
- Target worksheet of the sum operation. Can be null if on the same worksheetrange
- Cell range to get a sum of- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
VLookup
public static Cell VLookup(Object number, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel function- Parameters:
number
- Numeric value for the lookup. Valid types are int, long, float and doublerange
- Matrix of the lookupcolumnIndex
- Column index of the target column (1 based)exactMatch
- If true, an exact match is applied to the lookup- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
VLookup
public static Cell VLookup(Object number, Worksheet rangeTarget, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel function- Parameters:
number
- Numeric value for the lookup. Valid types are int, long, float and doublerangeTarget
- Target worksheet of the matrix. Can be null if on the same worksheetrange
- Matrix of the lookupcolumnIndex
- Column index of the target column (1 based)exactMatch
- If true, an exact match is applied to the lookup- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
VLookup
public static Cell VLookup(Address address, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel function- Parameters:
address
- Query address of a cell as string as source of the lookuprange
- Matrix of the lookupcolumnIndex
- Column index of the target column (1 based)exactMatch
- If true, an exact match is applied to the lookup- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
VLookup
public static Cell VLookup(Worksheet queryTarget, Address address, Worksheet rangeTarget, Range range, int columnIndex, boolean exactMatch)
Function to generate a Vlookup as Excel function- Parameters:
queryTarget
- Target worksheet of the query argument. Can be null if on the same worksheetaddress
- Query address of a cell as string as source of the lookuprangeTarget
- Target worksheet of the matrix. Can be null if on the same worksheetrange
- Matrix of the lookupcolumnIndex
- Column index of the target column (1 based)exactMatch
- If true, an exact match is applied to the lookup- Returns:
- Prepared Cell Object, ready to be added to a worksheet
-
-