diff --git a/src/pycel/excelcompiler.py b/src/pycel/excelcompiler.py index ba5d63e..f876b91 100644 --- a/src/pycel/excelcompiler.py +++ b/src/pycel/excelcompiler.py @@ -824,7 +824,7 @@ def _evaluate_non_iterative(self, address): def _evaluate_iterative(self, address, iterations=None, tolerance=None): """ evaluate a cell or cells in a spreadsheet with cycles - reference: https://support.office.com/en-us/article/ + reference: https://support.microsoft.com/en-us/office/ 8540bd0f-6e97-4483-bcf7-1b49cd50d123 :param address: str, AddressRange, AddressCell or a tuple or list diff --git a/src/pycel/excelformula.py b/src/pycel/excelformula.py index 0abee13..557f04d 100644 --- a/src/pycel/excelformula.py +++ b/src/pycel/excelformula.py @@ -530,7 +530,7 @@ def func_column(self): } def func_subtotal(self): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # SUBTOTAL-function-7B027003-F060-4ADE-9040-E478765B9939 # Note: This does not implement skipping hidden rows. diff --git a/src/pycel/excellib.py b/src/pycel/excellib.py index 000af43..4182e94 100644 --- a/src/pycel/excellib.py +++ b/src/pycel/excellib.py @@ -50,7 +50,7 @@ def _numerics(*args, keep_bools=False, to_number=lambda x: x): def average(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # average-function-047bac88-d466-426c-a32b-8f33eb960cf6 data = _numerics(*args) @@ -64,7 +64,7 @@ def average(*args): def averageif(rng, criteria, average_range=None): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # averageif-function-faec8e2e-0dec-4308-af69-f5576d8ac642 # WARNING: @@ -80,7 +80,7 @@ def averageif(rng, criteria, average_range=None): def averageifs(average_range, *args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # AVERAGEIFS-function-48910C45-1FC0-4389-A028-F7C5C3001690 if not list_like(average_range): average_range = ((average_range, ), ) @@ -99,7 +99,7 @@ def averageifs(average_range, *args): @excel_math_func def ceiling(number, significance): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # CEILING-function-0A5CD7C8-0720-4F0A-BD2C-C943E510899F if significance < 0 < number: return NUM_ERROR @@ -115,7 +115,7 @@ def ceiling(number, significance): @excel_math_func def ceiling_math(number, significance=1, mode=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ceiling-math-function-80f95d2f-b499-4eee-9f16-f795a8e306c8 if significance == 0: return 0 @@ -128,7 +128,7 @@ def ceiling_math(number, significance=1, mode=0): @excel_math_func def ceiling_precise(number, significance=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ceiling-precise-function-f366a774-527a-4c92-ba49-af0a196e66cb if significance == 0: return 0 @@ -138,7 +138,7 @@ def ceiling_precise(number, significance=1): def count(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # COUNT-function-a59cd7fc-b623-4d93-87a4-d23bf411294c return sum(1 for x in flatten(args) @@ -146,7 +146,7 @@ def count(*args): def countif(rng, criteria): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # COUNTIF-function-e0de10c6-f885-4e71-abb4-1f464816df34 if not list_like(rng): rng = ((rng, ), ) @@ -156,7 +156,7 @@ def countif(rng, criteria): def conditional_format_ids(*args): """helper function for getting conditional format ids""" - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # E09711A3-48DF-4BCB-B82C-9D8B8B22463D results = [] @@ -169,7 +169,7 @@ def conditional_format_ids(*args): def countifs(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # COUNTIFS-function-dda3dc6e-f74e-4aee-88bc-aa8c2a866842 coords = handle_ifs(args) @@ -182,21 +182,21 @@ def countifs(*args): @excel_math_func def even(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # even-function-197b5f06-c795-4c1e-8696-3c3b8a646cf9 return math.copysign(math.ceil(abs(value) / 2) * 2, value) @excel_math_func def fact(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # fact-function-ca8588c2-15f2-41c0-8e8c-c11bd471a4f3 return math.factorial(int(value)) if value >= 0 else NUM_ERROR @excel_helper(cse_params=-1) def factdouble(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # fact-function-ca8588c2-15f2-41c0-8e8c-c11bd471a4f3 if isinstance(value, bool): return VALUE_ERROR @@ -211,7 +211,7 @@ def factdouble(value): @excel_math_func def floor(number, significance): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # FLOOR-function-14BB497C-24F2-4E04-B327-B0B4DE5A8886 if significance < 0 < number: return NUM_ERROR @@ -227,7 +227,7 @@ def floor(number, significance): @excel_math_func def floor_math(number, significance=1, mode=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # floor-math-function-c302b599-fbdb-4177-ba19-2c2b1249a2f5 if significance == 0: return 0 @@ -240,7 +240,7 @@ def floor_math(number, significance=1, mode=0): @excel_math_func def floor_precise(number, significance=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # floor-precise-function-f769b468-1452-4617-8dc3-02f842a0702e if significance == 0: return 0 @@ -251,7 +251,7 @@ def floor_precise(number, significance=1): @excel_helper() def large(array, k): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # large-function-3af0af19-1190-42bb-bb8b-01672ec00a64 data = _numerics(array, to_number=coerce_to_number) if isinstance(data, str): @@ -295,20 +295,20 @@ def assert_vector(data): @excel_math_func def ln(arg): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # LN-function-81FE1ED7-DAC9-4ACD-BA1D-07A142C6118F return math.log(arg) @excel_math_func def log(number, base=10): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # LOG-function-4E82F196-1CA9-4747-8FB0-6C4A3ABB3280 return math.log(number, base) def maxifs(max_range, *args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # maxifs-function-dfd611e6-da2c-488a-919b-9b6376b28883 if not list_like(max_range): max_range = ((max_range, ), ) @@ -329,7 +329,7 @@ def maxifs(max_range, *args): def minifs(min_range, *args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # minifs-function-6ca1ddaa-079b-4e74-80cc-72eef32e6599 if not list_like(min_range): min_range = ((min_range, ), ) @@ -351,7 +351,7 @@ def minifs(min_range, *args): @excel_math_func def mod(number, divisor): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # MOD-function-9b6cd169-b6ee-406a-a97b-edf2a9dc24f3 if divisor == 0: return DIV0 @@ -361,7 +361,7 @@ def mod(number, divisor): @excel_helper(cse_params=None, err_str_params=-1, number_params=0) def npv(rate, *args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # NPV-function-8672CB67-2576-4D07-B67B-AC28ACF2A568 rate += 1 @@ -372,14 +372,14 @@ def npv(rate, *args): @excel_math_func def odd(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # odd-function-deae64eb-e08a-4c88-8b40-6d0b42575c98 return math.copysign(math.ceil((abs(value) - 1) / 2) * 2 + 1, value) @excel_math_func def power(number, power): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # POWER-function-D3F2908B-56F4-4C3F-895A-07FB519C362A if number == power == 0: # Really excel? What were you thinking? @@ -393,7 +393,7 @@ def power(number, power): @excel_math_func def pv(rate, nper, pmt, fv=0, type_=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # pv-function-23879d31-0e02-4321-be01-da16e8168cbd if rate != 0: @@ -411,28 +411,28 @@ def _round(number, num_digits, rounding): @excel_math_func def rounddown(number, num_digits): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ROUNDDOWN-function-2EC94C73-241F-4B01-8C6F-17E6D7968F53 return _round(number, num_digits, rounding=ROUND_DOWN) @excel_math_func def roundup(number, num_digits): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ROUNDUP-function-F8BC9B23-E795-47DB-8703-DB171D0C42A7 return _round(number, num_digits, rounding=ROUND_UP) @excel_math_func def sign(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # sign-function-109c932d-fcdc-4023-91f1-2dd0e916a1d8 return -1 if value < 0 else int(bool(value)) @excel_helper() def small(array, k): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # small-function-17da8222-7c82-42b2-961b-14c45384df07 data = _numerics(array, to_number=coerce_to_number) if isinstance(data, str): @@ -450,7 +450,7 @@ def small(array, k): def sumif(rng, criteria, sum_range=None): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # SUMIF-function-169b8c99-c05c-4483-a712-1697a653039b # WARNING: @@ -467,7 +467,7 @@ def sumif(rng, criteria, sum_range=None): def sumifs(sum_range, *args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # SUMIFS-function-C9E748F5-7EA7-455D-9406-611CEBCE642B if not list_like(sum_range): sum_range = ((sum_range, ), ) @@ -485,7 +485,7 @@ def sumifs(sum_range, *args): def sumproduct(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # SUMPRODUCT-function-16753E75-9F68-4874-94AC-4D2145A2FD2E # find any errors @@ -512,7 +512,7 @@ def sumproduct(*args): @excel_math_func def trunc(number, num_digits=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # TRUNC-function-8B86A64C-3127-43DB-BA14-AA5CEB292721 factor = 10 ** int(num_digits) return int(number * factor) / factor @@ -520,14 +520,14 @@ def trunc(number, num_digits=0): @excel_math_func def x_abs(value1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ABS-function-3420200F-5628-4E8C-99DA-C99D7C87713C return abs(value1) @excel_math_func def xatan2(x_num, y_num): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ATAN2-function-C04592AB-B9E3-4908-B428-C96B3A565033 # swap arguments @@ -536,7 +536,7 @@ def xatan2(x_num, y_num): @excel_math_func def x_int(value1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # INT-function-A6C4AF9E-356D-4369-AB6A-CB1FD9D343EF return math.floor(value1) @@ -571,7 +571,7 @@ def xmin(*args): @excel_math_func def x_round(number, num_digits=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ROUND-function-c018c5d8-40fb-4053-90b1-b3e7f61a213c num_digits = int(num_digits) diff --git a/src/pycel/excelutil.py b/src/pycel/excelutil.py index a92c70f..f2994a5 100644 --- a/src/pycel/excelutil.py +++ b/src/pycel/excelutil.py @@ -564,7 +564,7 @@ def split_sheetname(address, sheet=''): def structured_reference_boundaries(address, cell=None): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # Using-structured-references-with-Excel-tables- # F5ED2452-2337-4F71-BED3-C8AE6D2B276E diff --git a/src/pycel/lib/date_time.py b/src/pycel/lib/date_time.py index b664289..187d7d9 100644 --- a/src/pycel/lib/date_time.py +++ b/src/pycel/lib/date_time.py @@ -184,7 +184,7 @@ def yearfrac_basis_1(beg, end): @excel_helper(number_params=-1) def date(year, month_, day): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # DATE-function-e36c0c8c-4104-49da-ab83-82328b832349 if not (0 <= year <= 9999): @@ -204,7 +204,7 @@ def date(year, month_, day): # def datedif(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c @@ -224,7 +224,7 @@ def validate(self, res): def datevalue(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # datevalue-function-df8b07d4-7761-4a93-bc33-b7471bbff252 parserinfo = DateutilParserInfo() try: @@ -247,31 +247,31 @@ def datevalue(value): @serial_number_wrapper def day(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # day-function-8a7d1cbb-6c7d-4ba1-8aea-25c134d03101 return date_from_int(math.floor(serial_number))[2] # def days(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # days-function-57740535-d549-4395-8728-0f07bff0b9df # def days360(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # days360-function-b9a509fd-49ef-407e-94df-0cbda5718c2a @excel_helper(err_str_params=-1) def edate(start_date, months): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # edate-function-3c920eb2-6e66-44e7-a1f5-753ae47ee4f5 return months_inc(start_date, months) @excel_helper(err_str_params=-1) def eomonth(start_date, months): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # eomonth-function-7314ffa1-2bc9-4005-9d66-f49db127d628 return months_inc(start_date, months, eomonth=True) @@ -294,42 +294,42 @@ def months_inc(start_date, months, eomonth=False): @time_value_wrapper def hour(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # hour-function-a3afa879-86cb-4339-b1b5-2dd2d7310ac7 return time_from_serialnumber(serial_number)[0] # def isoweeknum(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # isoweeknum-function-1c2d0afe-d25b-4ab1-8894-8d0520e90e0e @time_value_wrapper def minute(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # minute-function-af728df0-05c4-4b07-9eed-a84801a60589 return time_from_serialnumber(serial_number)[1] @serial_number_wrapper def month(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # month-function-579a2881-199b-48b2-ab90-ddba0eba86e8 return date_from_int(math.floor(serial_number))[1] # def networkdays(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # networkdays-function-48e717bf-a7a3-495f-969e-5005e3eb18e7 # def networkdays.intl(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # networkdays-intl-function-a9b26239-4f20-46a1-9ab8-4e925bfd5e28 def now(): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # now-function-3337fd29-145a-4347-b2e6-20c904739c46 delta = dt.datetime.now() - DATE_ZERO return delta.days + delta.seconds * SECOND @@ -337,18 +337,18 @@ def now(): @time_value_wrapper def second(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # second-function-740d1cfc-553c-4099-b668-80eaa24e8af1 return time_from_serialnumber(serial_number)[2] # def time(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # time-function-9a5aff99-8f7d-4611-845e-747d0b8d5457 def timevalue(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # timevalue-function-0b615c12-33d8-4431-bf3d-f3eb6d186645 if not isinstance(value, str): return VALUE_ERROR @@ -382,43 +382,43 @@ def timevalue(value): def today(): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # today-function-5eb3078d-a82c-4736-8930-2f51a028fdd9 return (dt.date.today() - DATE_ZERO.date()).days @serial_number_wrapper def weekday(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # weekday-function-60e44483-2ed1-439f-8bd0-e404c190949a return (math.floor(serial_number) - 1) % 7 + 1 # def weeknum(serial_number, return_Type=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # weeknum-function-e5c43a03-b4ab-426c-b411-b18c13c75340 # def workday(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # workday-function-f764a5b7-05fc-4494-9486-60d494efbf33 # def workday.intl(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # workday-intl-function-a378391c-9ba7-4678-8a39-39611a9bf81d @serial_number_wrapper def year(serial_number): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # year-function-c64f017a-1354-490d-981f-578e8ec8d3b9 return date_from_int(math.floor(serial_number))[0] @excel_helper(cse_params=-1, err_str_params=2, number_params=None) def yearfrac(start_date, end_date, basis=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # YEARFRAC-function-3844141e-c76d-4143-82b6-208454ddc6a8 if isinstance(basis, (bool, str)): return VALUE_ERROR diff --git a/src/pycel/lib/engineering.py b/src/pycel/lib/engineering.py index 0613d70..8e1f0de 100644 --- a/src/pycel/lib/engineering.py +++ b/src/pycel/lib/engineering.py @@ -93,43 +93,43 @@ def _base2base(value, places=None, base_in=16, base_out=16): # def besseli(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # besseli-function-8d33855c-9a8d-444b-98e0-852267b1c0df # def besselj(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # besselj-function-839cb181-48de-408b-9d80-bd02982d94f7 # def besselk(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # besselk-function-606d11bc-06d3-4d53-9ecb-2803e2b90b70 # def bessely(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # bessely-function-f3a356b3-da89-42c3-8974-2da54d6353a2 -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # BIN2DEC-function-63905B57-B3A0-453D-99F4-647BB519CD6C bin2dec = functools.partial(_base2dec, base=2) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # BIN2HEX-function-0375E507-F5E5-4077-9AF8-28D84F9F41CC bin2hex = functools.partial(_base2base, base_in=2, base_out=16) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # BIN2OCT-function-0A4E01BA-AC8D-4158-9B29-16C25C4C23FD bin2oct = functools.partial(_base2base, base_in=2, base_out=8) @excel_math_func def bitand(op_x, op_y): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # bitand-function-8a2be3d7-91c3-4b48-9517-64548008563a if op_x < 0 or op_y < 0: return NUM_ERROR @@ -138,7 +138,7 @@ def bitand(op_x, op_y): @excel_math_func def bitlshift(number, pos): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # bitlshift-function-c55bb27e-cacd-4c7c-b258-d80861a03c9c if number < 0 or abs(pos) > 53 or number >= 2**48: return NUM_ERROR @@ -149,7 +149,7 @@ def bitlshift(number, pos): @excel_math_func def bitor(op_x, op_y): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # bitor-function-f6ead5c8-5b98-4c9e-9053-8ad5234919b2 if op_x < 0 or op_y < 0: return NUM_ERROR @@ -158,7 +158,7 @@ def bitor(op_x, op_y): @excel_math_func def bitrshift(number, pos): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # bitrshift-function-274d6996-f42c-4743-abdb-4ff95351222c if number < 0 or abs(pos) > 53 or number >= 2 ** 48: return NUM_ERROR @@ -169,7 +169,7 @@ def bitrshift(number, pos): @excel_math_func def bitxor(op_x, op_y): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # bitxor-function-c81306a1-03f9-4e89-85ac-b86c3cba10e4 if op_x < 0 or op_y < 0: return NUM_ERROR @@ -177,210 +177,210 @@ def bitxor(op_x, op_y): # def complex(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # complex-function-f0b8f3a9-51cc-4d6d-86fb-3a9362fa4128 # def convert(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # convert-function-d785bef1-808e-4aac-bdcd-666c810f9af2 -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # DEC2BIN-function-0F63DD0E-5D1A-42D8-B511-5BF5C6D43838 dec2bin = functools.partial(_dec2base, base=2) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # DEC2HEX-function-6344EE8B-B6B5-4C6A-A672-F64666704619 dec2hex = functools.partial(_dec2base, base=16) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # DEC2OCT-function-C9D835CA-20B7-40C4-8A9E-D3BE351CE00F dec2oct = functools.partial(_dec2base, base=8) # def delta(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # delta-function-2f763672-c959-4e07-ac33-fe03220ba432 # def erf(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # erf-function-c53c7e7b-5482-4b6c-883e-56df3c9af349 # def erf.precise(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # erf-precise-function-9a349593-705c-4278-9a98-e4122831a8e0 # def erfc(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # erfc-function-736e0318-70ba-4e8b-8d08-461fe68b71b3 # def erfc.precise(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # erfc-precise-function-e90e6bab-f45e-45df-b2ac-cd2eb4d4a273 # def gestep(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # gestep-function-f37e7d2a-41da-4129-be95-640883fca9df -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # HEX2BIN-function-A13AAFAA-5737-4920-8424-643E581828C1 hex2bin = functools.partial(_base2base, base_in=16, base_out=2) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # HEX2DEC-function-8C8C3155-9F37-45A5-A3EE-EE5379EF106E hex2dec = functools.partial(_base2dec, base=16) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # HEX2OCT-function-54D52808-5D19-4BD0-8A63-1096A5D11912 hex2oct = functools.partial(_base2base, base_in=16, base_out=8) # def imabs(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imabs-function-b31e73c6-d90c-4062-90bc-8eb351d765a1 # def imaginary(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imaginary-function-dd5952fd-473d-44d9-95a1-9a17b23e428a # def imargument(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imargument-function-eed37ec1-23b3-4f59-b9f3-d340358a034a # def imconjugate(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imconjugate-function-2e2fc1ea-f32b-4f9b-9de6-233853bafd42 # def imcos(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imcos-function-dad75277-f592-4a6b-ad6c-be93a808a53c # def imcosh(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imcosh-function-053e4ddb-4122-458b-be9a-457c405e90ff # def imcot(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imcot-function-dc6a3607-d26a-4d06-8b41-8931da36442c # def imcsc(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imcsc-function-9e158d8f-2ddf-46cd-9b1d-98e29904a323 # def imcsch(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imcsch-function-c0ae4f54-5f09-4fef-8da0-dc33ea2c5ca9 # def imdiv(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imdiv-function-a505aff7-af8a-4451-8142-77ec3d74d83f # def imexp(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imexp-function-c6f8da1f-e024-4c0c-b802-a60e7147a95f # def imln(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imln-function-32b98bcf-8b81-437c-a636-6fb3aad509d8 # def imlog10(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imlog10-function-58200fca-e2a2-4271-8a98-ccd4360213a5 # def imlog2(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imlog2-function-152e13b4-bc79-486c-a243-e6a676878c51 # def impower(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # impower-function-210fd2f5-f8ff-4c6a-9d60-30e34fbdef39 # def improduct(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # improduct-function-2fb8651a-a4f2-444f-975e-8ba7aab3a5ba # def imreal(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imreal-function-d12bc4c0-25d0-4bb3-a25f-ece1938bf366 # def imsec(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsec-function-6df11132-4411-4df4-a3dc-1f17372459e0 # def imsech(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsech-function-f250304f-788b-4505-954e-eb01fa50903b # def imsin(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsin-function-1ab02a39-a721-48de-82ef-f52bf37859f6 # def imsinh(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsinh-function-dfb9ec9e-8783-4985-8c42-b028e9e8da3d # def imsqrt(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsqrt-function-e1753f80-ba11-4664-a10e-e17368396b70 # def imsub(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsub-function-2e404b4d-4935-4e85-9f52-cb08b9a45054 # def imsum(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imsum-function-81542999-5f1c-4da6-9ffe-f1d7aaa9457f # def imtan(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # imtan-function-8478f45d-610a-43cf-8544-9fc0b553a132 -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # OCT2BIN-function-55383471-3C56-4D27-9522-1A8EC646C589 oct2bin = functools.partial(_base2base, base_in=8, base_out=2) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # OCT2DEC-function-87606014-CB98-44B2-8DBB-E48F8CED1554 oct2dec = functools.partial(_base2dec, base=8) -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # OCT2HEX-function-912175B4-D497-41B4-A029-221F051B858F oct2hex = functools.partial(_base2base, base_in=8, base_out=16) diff --git a/src/pycel/lib/function_info.py b/src/pycel/lib/function_info.py index 8339d3e..b4c26ac 100644 --- a/src/pycel/lib/function_info.py +++ b/src/pycel/lib/function_info.py @@ -17,7 +17,7 @@ # function name to excel version and function category function_version = {f.name: f.version for f in function_info} function_category = {f.name: f.category for f in function_info} -base_url = 'https://support.office.com/en-us/article/' +base_url = 'https://support.microsoft.com/en-us/office/' def func_status_msg(name): @@ -40,6 +40,7 @@ def scrape_function_list(): # pragma: no cover """ import requests from bs4 import BeautifulSoup + from urllib.parse import urlparse base_dir = os.path.dirname(__file__) tmp_data_name = 'tmp_function_list_page' @@ -62,6 +63,7 @@ def scrape_function_list(): # pragma: no cover web_data = importlib.import_module('pycel.lib.{}'.format(tmp_data_name)) soup = BeautifulSoup(web_data.page_html, 'html.parser') + base_url_path = urlparse(base_url).path table = max(((len(table.find_all('tr')), table) for table in soup.find_all('table')))[1] @@ -71,12 +73,14 @@ def scrape_function_list(): # pragma: no cover if ':' not in p[1]: continue href = tuple(a.get('href') for a in row.find_all('a')) - row_url = href[-1] + row_url = href[-1].replace(base_url_path, '') name = p[0].strip().replace(' function', '') category, description = (x.strip() for x in p[1].split(':', 1)) version = '' for img in row.find_all('img'): version = img['alt'].replace(' button', '') + if version.startswith('20') and len(version) == 4: + version = f'Excel {version}' rows_data.append((name, category, version, row_url, description)) with open(os.path.join(base_dir, 'function_info_data.py'), 'w') as f: diff --git a/src/pycel/lib/function_info_data.py b/src/pycel/lib/function_info_data.py index 002490e..8d1496a 100644 --- a/src/pycel/lib/function_info_data.py +++ b/src/pycel/lib/function_info_data.py @@ -52,7 +52,7 @@ FunctionInfo('BITRSHIFT', 'Engineering', 'Excel 2013', 'bitrshift-function-274d6996-f42c-4743-abdb-4ff95351222c'), FunctionInfo('BITXOR', 'Engineering', 'Excel 2013', 'bitxor-function-c81306a1-03f9-4e89-85ac-b86c3cba10e4'), FunctionInfo('CALL', 'Add-in and Automation', '', 'call-function-32d58445-e646-4ffd-8d5e-b45077a5e995'), - FunctionInfo('CEILING', 'Math and trigonometry', '', 'ceiling-function-0a5cd7c8-0720-4f0a-bd2c-c943e510899f'), + FunctionInfo('CEILING', 'Compatibility', '', 'ceiling-function-0a5cd7c8-0720-4f0a-bd2c-c943e510899f'), FunctionInfo('CEILING.MATH', 'Math and trigonometry', 'Excel 2013', 'ceiling-math-function-80f95d2f-b499-4eee-9f16-f795a8e306c8'), FunctionInfo('CEILING.PRECISE', 'Math and trigonometry', '', 'ceiling-precise-function-f366a774-527a-4c92-ba49-af0a196e66cb'), FunctionInfo('CELL', 'Information', '', 'cell-function-51bd39a5-f338-4dbe-a33f-955d67c2b2cf'), @@ -73,7 +73,7 @@ FunctionInfo('COMBIN', 'Math and trigonometry', '', 'combin-function-12a3f276-0a21-423a-8de6-06990aaf638a'), FunctionInfo('COMBINA', 'Math and trigonometry', 'Excel 2013', 'combina-function-efb49eaa-4f4c-4cd2-8179-0ddfcf9d035d'), FunctionInfo('COMPLEX', 'Engineering', '', 'complex-function-f0b8f3a9-51cc-4d6d-86fb-3a9362fa4128'), - FunctionInfo('CONCAT', 'Text', 'Excel 2016', 'concat-function-9b1a9a3f-94ff-41af-9736-694cbd6b4ca2'), + FunctionInfo('CONCAT', 'Text', 'Excel 2019', 'concat-function-9b1a9a3f-94ff-41af-9736-694cbd6b4ca2'), FunctionInfo('CONCATENATE', 'Text', '', 'concatenate-function-8f8ae884-2ca8-4f7a-b093-75d702bea31d'), FunctionInfo('CONFIDENCE', 'Compatibility', '', 'confidence-function-75ccc007-f77c-4343-bc14-673642091ad6'), FunctionInfo('CONFIDENCE.NORM', 'Statistical', 'Excel 2010', 'confidence-norm-function-7cec58a6-85bb-488d-91c3-63828d4fbfd4'), @@ -170,7 +170,7 @@ FunctionInfo('FINDB', 'Text', '', 'find-findb-functions-c7912941-af2a-4bdf-a553-d0d89b0a0628'), FunctionInfo('F.INV', 'Statistical', 'Excel 2010', 'f-inv-function-0dda0cf9-4ea0-42fd-8c3c-417a1ff30dbe'), FunctionInfo('F.INV.RT', 'Statistical', 'Excel 2010', 'f-inv-rt-function-d371aa8f-b0b1-40ef-9cc2-496f0693ac00'), - FunctionInfo('FINV', 'Statistical', '', 'finv-function-4d46c97c-c368-4852-bc15-41e8e31140b1'), + FunctionInfo('FINV', 'Compatibility', '', 'finv-function-4d46c97c-c368-4852-bc15-41e8e31140b1'), FunctionInfo('FISHER', 'Statistical', '', 'fisher-function-d656523c-5076-4f95-b87b-7741bf236c69'), FunctionInfo('FISHERINV', 'Statistical', '', 'fisherinv-function-62504b39-415a-4284-a285-19c8e82f86bb'), FunctionInfo('FIXED', 'Text', '', 'fixed-function-ffd5723c-324c-45e9-8b96-e41be2a8274a'), @@ -214,7 +214,7 @@ FunctionInfo('IF', 'Logical', '', 'if-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2'), FunctionInfo('IFERROR', 'Logical', '', 'iferror-function-c526fd07-caeb-47b8-8bb6-63f3e417f611'), FunctionInfo('IFNA', 'Logical', 'Excel 2013', 'ifna-function-6626c961-a569-42fc-a49d-79b4951fd461'), - FunctionInfo('IFS', 'Logical', 'Excel 2016', 'ifs-function-36329a26-37b2-467c-972b-4a39bd951d45'), + FunctionInfo('IFS', 'Logical', 'Excel 2019', 'ifs-function-36329a26-37b2-467c-972b-4a39bd951d45'), FunctionInfo('IMABS', 'Engineering', '', 'imabs-function-b31e73c6-d90c-4062-90bc-8eb351d765a1'), FunctionInfo('IMAGINARY', 'Engineering', '', 'imaginary-function-dd5952fd-473d-44d9-95a1-9a17b23e428a'), FunctionInfo('IMARGUMENT', 'Engineering', '', 'imargument-function-eed37ec1-23b3-4f59-b9f3-d340358a034a'), @@ -271,6 +271,7 @@ FunctionInfo('LEFTB', 'Text', '', 'left-leftb-functions-9203d2d2-7960-479b-84c6-1ea52b99640c'), FunctionInfo('LEN', 'Text', '', 'len-lenb-functions-29236f94-cedc-429d-affd-b5e33d2c67cb'), FunctionInfo('LENB', 'Text', '', 'len-lenb-functions-29236f94-cedc-429d-affd-b5e33d2c67cb'), + FunctionInfo('LET', 'Math and trigonometry', 'Office 365', 'let-function-34842dd8-b92b-4d3f-b325-b8b8f9908999'), FunctionInfo('LINEST', 'Statistical', '', 'linest-function-84d7d0d9-6e50-4101-977a-fa7abf772b6d'), FunctionInfo('LN', 'Math and trigonometry', '', 'ln-function-81fe1ed7-dac9-4acd-ba1d-07a142c6118f'), FunctionInfo('LOG', 'Math and trigonometry', '', 'log-function-4e82f196-1ca9-4747-8fb0-6c4a3abb3280'), @@ -285,14 +286,14 @@ FunctionInfo('MATCH', 'Lookup and reference', '', 'match-function-e8dffd45-c762-47d6-bf89-533f4a37673a'), FunctionInfo('MAX', 'Statistical', '', 'max-function-e0012414-9ac8-4b34-9a47-73e662c08098'), FunctionInfo('MAXA', 'Statistical', '', 'maxa-function-814bda1e-3840-4bff-9365-2f59ac2ee62d'), - FunctionInfo('MAXIFS', 'Statistical', 'Excel 2016', 'maxifs-function-dfd611e6-da2c-488a-919b-9b6376b28883'), + FunctionInfo('MAXIFS', 'Statistical', 'Excel 2019', 'maxifs-function-dfd611e6-da2c-488a-919b-9b6376b28883'), FunctionInfo('MDETERM', 'Math and trigonometry', '', 'mdeterm-function-e7bfa857-3834-422b-b871-0ffd03717020'), FunctionInfo('MDURATION', 'Financial', '', 'mduration-function-b3786a69-4f20-469a-94ad-33e5b90a763c'), FunctionInfo('MEDIAN', 'Statistical', '', 'median-function-d0916313-4753-414c-8537-ce85bdd967d2'), FunctionInfo('MID', 'Text', '', 'mid-midb-functions-d5f9e25c-d7d6-472e-b568-4ecb12433028'), FunctionInfo('MIDB', 'Text', '', 'mid-midb-functions-d5f9e25c-d7d6-472e-b568-4ecb12433028'), FunctionInfo('MIN', 'Statistical', '', 'min-function-61635d12-920f-4ce2-a70f-96f202dcc152'), - FunctionInfo('MINIFS', 'Statistical', 'Excel 2016', 'minifs-function-6ca1ddaa-079b-4e74-80cc-72eef32e6599'), + FunctionInfo('MINIFS', 'Statistical', 'Excel 2019', 'minifs-function-6ca1ddaa-079b-4e74-80cc-72eef32e6599'), FunctionInfo('MINA', 'Statistical', '', 'mina-function-245a6f46-7ca5-4dc7-ab49-805341bc31d3'), FunctionInfo('MINUTE', 'Date and time', '', 'minute-function-af728df0-05c4-4b07-9eed-a84801a60589'), FunctionInfo('MINVERSE', 'Math and trigonometry', '', 'minverse-function-11f55086-adde-4c9f-8eb9-59da2d72efc6'), @@ -400,7 +401,6 @@ FunctionInfo('SHEETS', 'Information', 'Excel 2013', 'sheets-function-770515eb-e1e8-45ce-8066-b557e5e4b80b'), FunctionInfo('SIGN', 'Math and trigonometry', '', 'sign-function-109c932d-fcdc-4023-91f1-2dd0e916a1d8'), FunctionInfo('SIN', 'Math and trigonometry', '', 'sin-function-cf0e3432-8b9e-483c-bc55-a76651c95602'), - FunctionInfo('SINGLE', 'Lookup and reference', '', 'single-function-7ca229ca-13ae-420b-928e-2ef52a3805ff'), FunctionInfo('SINH', 'Math and trigonometry', '', 'sinh-function-1e4e8b9f-2b65-43fc-ab8a-0a37f4081fa7'), FunctionInfo('SKEW', 'Statistical', '', 'skew-function-bdf49d86-b1ef-4804-a046-28eaea69c9fa'), FunctionInfo('SKEW.P', 'Statistical', 'Excel 2013', 'skew-p-function-76530a5c-99b9-48a1-8392-26632d542fcb'), @@ -442,7 +442,7 @@ FunctionInfo('T.DIST.RT', 'Statistical', 'Excel 2010', 't-dist-rt-function-20a30020-86f9-4b35-af1f-7ef6ae683eda'), FunctionInfo('TDIST', 'Compatibility', '', 'tdist-function-630a7695-4021-4853-9468-4a1f9dcdd192'), FunctionInfo('TEXT', 'Text', '', 'text-function-20d5ac4d-7b94-49fd-bb38-93d29371225c'), - FunctionInfo('TEXTJOIN', 'Text', 'Excel 2016', 'textjoin-function-357b449a-ec91-49d0-80c3-0e8fc845691c'), + FunctionInfo('TEXTJOIN', 'Text', 'Excel 2019', 'textjoin-function-357b449a-ec91-49d0-80c3-0e8fc845691c'), FunctionInfo('TIME', 'Date and time', '', 'time-function-9a5aff99-8f7d-4611-845e-747d0b8d5457'), FunctionInfo('TIMEVALUE', 'Date and time', '', 'timevalue-function-0b615c12-33d8-4431-bf3d-f3eb6d186645'), FunctionInfo('T.INV', 'Statistical', 'Excel 2010', 't-inv-function-2908272b-4e61-4942-9df9-a25fec9b0e2e'), @@ -479,6 +479,8 @@ FunctionInfo('WORKDAY', 'Date and time', '', 'workday-function-f764a5b7-05fc-4494-9486-60d494efbf33'), FunctionInfo('WORKDAY.INTL', 'Date and time', 'Excel 2010', 'workday-intl-function-a378391c-9ba7-4678-8a39-39611a9bf81d'), FunctionInfo('XIRR', 'Financial', '', 'xirr-function-de1242ec-6477-445b-b11b-a303ad9adc9d'), + FunctionInfo('XLOOKUP', 'Lookup and reference', 'Office 365', 'xlookup-function-b7fd680e-6d10-43e6-84f9-88eae8bf5929'), + FunctionInfo('XMATCH', 'Lookup and reference', 'Office 365', 'xmatch-function-d966da31-7a6b-4a13-a1c6-5a33ed6a0312'), FunctionInfo('XNPV', 'Financial', '', 'xnpv-function-1b42bbf6-370f-4532-a0eb-d67c16b664b7'), FunctionInfo('XOR', 'Logical', 'Excel 2013', 'xor-function-1548d4c2-5e47-4f77-9a92-0533bba14f37'), FunctionInfo('YEAR', 'Date and time', '', 'year-function-c64f017a-1354-490d-981f-578e8ec8d3b9'), diff --git a/src/pycel/lib/information.py b/src/pycel/lib/information.py index 8546540..5c56bf1 100644 --- a/src/pycel/lib/information.py +++ b/src/pycel/lib/information.py @@ -22,30 +22,30 @@ # def cell(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # cell-function-51bd39a5-f338-4dbe-a33f-955d67c2b2cf # def error.type(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # error-type-function-10958677-7c8d-44f7-ae77-b9a9ee6eefaa # def info(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # info-function-725f259a-0e4b-49b3-8b52-58815c69acae @excel_helper(cse_params=0, err_str_params=None) def isblank(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 return value is None @excel_helper(cse_params=0, err_str_params=None) def iserr(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 # Value refers to any error value except #N/A. return isinstance(value, str) and value in ERROR_CODES and value != NA_ERROR @@ -53,7 +53,7 @@ def iserr(value): @excel_helper(cse_params=0, err_str_params=None) def iserror(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 # Value refers to any error value: # (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!). @@ -63,48 +63,48 @@ def iserror(value): @excel_helper(cse_params=0) def iseven(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # iseven-function-aa15929a-d77b-4fbb-92f4-2f479af55356 result = isodd(value) return not result if isinstance(result, bool) else result # def isformula(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # isformula-function-e4d1355f-7121-4ef2-801e-3839bfd6b1e5 @excel_helper(cse_params=0, err_str_params=None) def islogical(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 return isinstance(value, bool) @excel_helper(cse_params=0, err_str_params=None) def isna(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 return value == NA_ERROR or isinstance(value, tuple) @excel_helper(cse_params=0, err_str_params=None) def isnontext(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 return not isinstance(value, str) or value in ERROR_CODES @excel_helper(cse_params=0, err_str_params=None) def isnumber(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 return not isinstance(value, bool) and isinstance(value, (int, float)) @excel_helper(cse_params=0) def isodd(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 if isinstance(value, bool): return VALUE_ERROR @@ -117,20 +117,20 @@ def isodd(value): # def isref(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 @excel_helper(cse_params=0, err_str_params=None) def istext(arg): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # is-functions-0f2d7971-6019-40a0-a171-f2d869135665 return isinstance(arg, str) and arg not in ERROR_CODES @excel_helper(cse_params=0, err_str_params=0) def n(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # n-function-a624cad1-3635-4208-b54a-29733d1278c9 if isinstance(value, str): return 0 @@ -140,21 +140,21 @@ def n(value): def na(): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # na-function-5469c2d1-a90c-4fb5-9bbc-64bd9bb6b47c return NA_ERROR # def sheet(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # sheet-function-44718b6f-8b87-47a1-a9d6-b701c06cff24 # def sheets(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # sheets-function-770515eb-e1e8-45ce-8066-b557e5e4b80b # def type(value): -# # Excel reference: https://support.office.com/en-us/article/ +# # Excel reference: https://support.microsoft.com/en-us/office/ # # type-function-45b4e688-4bc3-48b3-a105-ffa892995899 diff --git a/src/pycel/lib/logical.py b/src/pycel/lib/logical.py index 824b624..061bf3a 100644 --- a/src/pycel/lib/logical.py +++ b/src/pycel/lib/logical.py @@ -61,7 +61,7 @@ def _clean_logicals(*args): def x_and(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # and-function-5f19b2e8-e1df-4408-897a-ce285a19e9d9 values = _clean_logicals(*args) @@ -74,7 +74,7 @@ def x_and(*args): @excel_helper(cse_params=(0, 1, 2), err_str_params=0) def x_if(test, true_value, false_value=0): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # IF-function-69AED7C9-4E8A-4755-A9BC-AA8BBFF73BE2 cleaned = _clean_logical(test) @@ -87,7 +87,7 @@ def x_if(test, true_value, false_value=0): def iferror(arg, value_if_error): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # IFERROR-function-C526FD07-CAEB-47B8-8BB6-63F3E417F611 if in_array_formula_context and ( @@ -103,7 +103,7 @@ def iferror(arg, value_if_error): # Excel 2013 # Returns the value you specify if the expression resolves to #N/A, # otherwise returns the result of the expression -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # ifna-function-6626c961-a569-42fc-a49d-79b4951fd461 @@ -112,7 +112,7 @@ def ifs(*args): # Excel 2016 # Checks whether one or more conditions are met and returns a value that # corresponds to the first TRUE condition. - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # ifs-function-36329a26-37b2-467c-972b-4a39bd951d45 if not len(args) % 2: for test, value in zip(args[::2], args[1::2]): @@ -136,7 +136,7 @@ def ifs(*args): def x_not(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # not-function-9cfc6011-a054-40c7-a140-cd4ba2d87d77 cleaned = _clean_logical(value) @@ -149,7 +149,7 @@ def x_not(value): def x_or(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # or-function-7d17ad14-8700-4281-b308-00b131e22af0 values = _clean_logicals(*args) @@ -165,12 +165,12 @@ def x_or(*args): # Evaluates an expression against a list of values and returns the result # corresponding to the first matching value. If there is no match, an optional # default value may be returned. -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # switch-function-47ab33c0-28ce-4530-8a45-d532ec4aa25e def x_xor(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # xor-function-1548d4c2-5e47-4f77-9a92-0533bba14f37 values = _clean_logicals(*args) if isinstance(values, str): diff --git a/src/pycel/lib/lookup.py b/src/pycel/lib/lookup.py index fcdacc6..deca55f 100644 --- a/src/pycel/lib/lookup.py +++ b/src/pycel/lib/lookup.py @@ -33,7 +33,7 @@ def _match(lookup_value, lookup_array, match_type=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # MATCH-function-E8DFFD45-C762-47D6-BF89-533F4A37673A """ The relative position of a specified item in a range of cells. @@ -105,18 +105,18 @@ def compare(idx, val): # def address(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # address-function-d0c26c0d-3991-446b-8de4-ab46431d4f89 # def areas(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # areas-function-8392ba32-7a41-43b3-96b0-3695d2ec6152 @excel_helper(cse_params=0, number_params=0, err_str_params=0) def choose(index, *args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # choose-function-fc5c184f-cb62-4ec7-a46e-38653b98f5bc index = int(index) if index < 1 or len(args) < index or not args: @@ -126,7 +126,7 @@ def choose(index, *args): @excel_helper(ref_params=0) def column(ref): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # COLUMN-function-44E8C754-711C-4DF3-9DA4-47A55042554B if ref.is_range: if ref.end.col_idx == 0: @@ -138,22 +138,22 @@ def column(ref): # def columns(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # columns-function-4e8e7b4e-e603-43e8-b177-956088fa48ca # def filter(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # filter-function-f4f7cb66-82eb-4767-8f7c-4877ad80c759 # def formulatext(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # formulatext-function-0a786771-54fd-4ae2-96ee-09cda35439c8 # def getpivotdata(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # getpivotdata-function-8c083b99-a922-4ca0-af5e-3af55960761f @@ -167,7 +167,7 @@ def hlookup(lookup_value, table_array, row_index_num, range_lookup=True): :param range_lookup: True, assumes sorted, finds nearest. False: find exact :return: #N/A if not found else value """ - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # hlookup-function-a3034eec-b719-4ba3-bb65-e1ad662ed95f if not list_like(table_array): @@ -190,13 +190,13 @@ def hlookup(lookup_value, table_array, row_index_num, range_lookup=True): # def hyperlink(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # hyperlink-function-333c7ce6-c5ae-4164-9c47-7de9b76f577f @excel_helper(err_str_params=(1, 2), number_params=(1, 2)) def index(array, row_num, col_num=None): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # index-function-a5dcf0dd-996d-40a4-a822-b56b061328bd if not list_like(array): @@ -242,7 +242,7 @@ def index(array, row_num, col_num=None): @excel_helper(cse_params=0, number_params=1) def indirect(ref_text, a1=True, sheet=''): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # indirect-function-474b3a3a-8a26-4f44-b491-92b6306fa261 try: address = AddressRange.create(ref_text) @@ -273,7 +273,7 @@ def lookup(lookup_value, lookup_array, result_range=None): :param result_range: (optional vector form) values are returned from here :return: #N/A if not found else value """ - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # lookup-function-446d94af-663b-451d-8251-369d5e3864cb if not list_like(lookup_array): return NA_ERROR @@ -315,7 +315,7 @@ def lookup(lookup_value, lookup_array, result_range=None): @excel_helper(cse_params=0, number_params=2, err_str_params=(0, 2)) def match(lookup_value, lookup_array, match_type=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # match-function-e8dffd45-c762-47d6-bf89-533f4a37673a if len(lookup_array) == 1: lookup_array = lookup_array[0] @@ -327,7 +327,7 @@ def match(lookup_value, lookup_array, match_type=1): @excel_helper(cse_params=-1, ref_params=0, number_params=(1, 2)) def offset(reference, row_inc, col_inc, height=None, width=None): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # offset-function-c8de19ae-dd79-4b9b-a14e-b4d906d11b66 """ Returns a reference to a range that is a specified number of rows and @@ -363,7 +363,7 @@ def offset(reference, row_inc, col_inc, height=None, width=None): @excel_helper(ref_params=0) def row(ref): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # row-function-3a63b74a-c4d0-4093-b49a-e76eb49a6d8d if ref.is_range: if ref.end.row == 0: @@ -375,37 +375,37 @@ def row(ref): # def rows(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # rows-function-b592593e-3fc2-47f2-bec1-bda493811597 # def rtd(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # rtd-function-e0cc001a-56f0-470a-9b19-9455dc0eb593 # def single(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # single-function-7ca229ca-13ae-420b-928e-2ef52a3805ff # def sort(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # sort-function-22f63bd0-ccc8-492f-953d-c20e8e44b86c # def sortby(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # sortby-function-cd2d7a62-1b93-435c-b561-d6a35134f28f # def transpose(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # transpose-function-ed039415-ed8a-4a81-93e9-4b6dfac76027 # def unique(value): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # unique-function-c5ab87fd-30a3-4ce9-9d1a-40204fb85e1e @@ -419,7 +419,7 @@ def vlookup(lookup_value, table_array, col_index_num, range_lookup=True): :param range_lookup: True, assumes sorted, finds nearest. False: find exact :return: #N/A if not found else value """ - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # VLOOKUP-function-0BBC8083-26FE-4963-8AB8-93A18AD188A1 if not list_like(table_array): @@ -442,3 +442,13 @@ def vlookup(lookup_value, table_array, col_index_num, range_lookup=True): else: # error string return result_idx + + +# def xlookup(value): + # Excel reference: https://support.microsoft.com/en-us/office/ + # xlookup-function-b7fd680e-6d10-43e6-84f9-88eae8bf5929 + + +# def xmatch(value): + # Excel reference: https://support.microsoft.com/en-us/office/ + # xmatch-function-d966da31-7a6b-4a13-a1c6-5a33ed6a0312 diff --git a/src/pycel/lib/text.py b/src/pycel/lib/text.py index 12ede91..713abee 100644 --- a/src/pycel/lib/text.py +++ b/src/pycel/lib/text.py @@ -25,38 +25,38 @@ # def asc(text): -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # asc-function-0b6abf1c-c663-4004-a964-ebc00b723266 # def bahttext(text): -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # bahttext-function-5ba4d0b4-abd3-4325-8d22-7a92d59aab9c # def char(text): -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # char-function-bbd249c8-b36e-4a91-8017-1c133f9b837a # def clean(text): -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # clean-function-26f3d7c5-475f-4a9c-90e5-4b8ba987ba41 # def code(text): -# Excel reference: https://support.office.com/en-us/article/ +# Excel reference: https://support.microsoft.com/en-us/office/ # code-function-c32b692b-2ed0-4a04-bdd9-75640144b928 def concat(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # concat-function-9b1a9a3f-94ff-41af-9736-694cbd6b4ca2 return concatenate(*tuple(flatten(args))) def concatenate(*args): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # CONCATENATE-function-8F8AE884-2CA8-4F7A-B093-75D702BEA31D if tuple(flatten(args)) != args: return VALUE_ERROR @@ -69,23 +69,23 @@ def concatenate(*args): # def dbcs(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # dbcs-function-a4025e73-63d2-4958-9423-21a24794c9e5 # def dollar(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # dollar-function-a6cd05d9-9740-4ad3-a469-8109d18ff611 # def exact(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # exact-function-d3087698-fc15-4a15-9631-12575cf29926 @excel_helper(cse_params=(0, 1, 2), number_params=2, str_params=(0, 1)) def find(find_text, within_text, start_num=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # FIND-FINDB-functions-C7912941-AF2A-4BDF-A553-D0D89B0A0628 found = within_text.find(find_text, start_num - 1) if found == -1: @@ -95,23 +95,23 @@ def find(find_text, within_text, start_num=1): # def findb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # find-findb-functions-c7912941-af2a-4bdf-a553-d0d89b0a0628 # def fixed(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # fixed-function-ffd5723c-324c-45e9-8b96-e41be2a8274a # def jis(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # jis-function-b72fb1a7-ba52-448a-b7d3-d2610868b7e2 @excel_helper(cse_params=(0, 1), number_params=1, str_params=0) def left(text, num_chars=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # LEFT-LEFTB-functions-9203D2D2-7960-479B-84C6-1EA52B99640C if num_chars < 0: return VALUE_ERROR @@ -120,32 +120,32 @@ def left(text, num_chars=1): # def leftb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # left-leftb-functions-9203d2d2-7960-479b-84c6-1ea52b99640c @excel_helper(cse_params=0) def x_len(arg): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # len-lenb-functions-29236f94-cedc-429d-affd-b5e33d2c67cb return 0 if arg is None else len(str(arg)) # def lenb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # len-lenb-functions-29236f94-cedc-429d-affd-b5e33d2c67cb @excel_helper(cse_params=0, str_params=0) def lower(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # lower-function-3f21df02-a80c-44b2-afaf-81358f9fdeb4 return text.lower() @excel_helper(cse_params=-1, number_params=(1, 2), str_params=0) def mid(text, start_num, num_chars): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # MID-MIDB-functions-d5f9e25c-d7d6-472e-b568-4ecb12433028 if start_num < 1 or num_chars < 0: @@ -157,28 +157,28 @@ def mid(text, start_num, num_chars): # def midb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # mid-midb-functions-d5f9e25c-d7d6-472e-b568-4ecb12433028 # def numbervalue(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # numbervalue-function-1b05c8cf-2bfa-4437-af70-596c7ea7d879 # def phonetic(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # phonetic-function-9a329dac-0c0f-42f8-9a55-639086988554 # def proper(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # proper-function-52a5a283-e8b2-49be-8506-b2887b889f94 @excel_helper(cse_params=-1, number_params=(1, 2), str_params=(0, 3)) def replace(old_text, start_num, num_chars, new_text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # replace-replaceb-functions-8d799074-2425-4a8a-84bc-82472868878a start_num = int(start_num) - 1 num_chars = int(num_chars) @@ -189,18 +189,18 @@ def replace(old_text, start_num, num_chars, new_text): # def replaceb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # replace-replaceb-functions-8d799074-2425-4a8a-84bc-82472868878a # def rept(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # rept-function-04c4d778-e712-43b4-9c15-d656582bb061 @excel_helper(cse_params=(0, 1), number_params=1, str_params=0) def right(text, num_chars=1): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # RIGHT-RIGHTB-functions-240267EE-9AFA-4639-A02B-F19E1786CF2F if num_chars < 0: @@ -212,23 +212,23 @@ def right(text, num_chars=1): # def rightb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # right-rightb-functions-240267ee-9afa-4639-a02b-f19e1786cf2f # def search(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # search-searchb-functions-9ab04538-0e55-4719-a72e-b6f54513b495 # def searchb(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # search-searchb-functions-9ab04538-0e55-4719-a72e-b6f54513b495 @excel_helper(cse_params=-1, str_params=(0, 1, 2)) def substitute(text, old_text, new_text, instance_num=None): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # substitute-function-6434944e-a904-4336-a9b0-1e58df3bc332 if instance_num is None: return text.replace(old_text, new_text) @@ -256,13 +256,13 @@ def substitute(text, old_text, new_text, instance_num=None): # def t(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # t-function-fb83aeec-45e7-4924-af95-53e073541228 @excel_helper(cse_params=0, str_params=(0, 1)) def text(text_value, value_format): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # text-function-20d5ac4d-7b94-49fd-bb38-93d29371225c def _get_datetime_format(excel_format): fmt = excel_format.lower() @@ -392,37 +392,37 @@ def _get_datetime_format(excel_format): return text_value # def textjoin(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # textjoin-function-357b449a-ec91-49d0-80c3-0e8fc845691c @excel_helper(cse_params=0, str_params=0) def trim(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # trim-function-410388fa-c5df-49c6-b16c-9e5630b479f9 return RE_MULTI_SPACE.sub(' ', text) # def unichar(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # unichar-function-ffeb64f5-f131-44c6-b332-5cd72f0659b8 # def unicode(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # unicode-function-adb74aaa-a2a5-4dde-aff6-966e4e81f16f @excel_helper(cse_params=0, str_params=0) def upper(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # upper-function-c11f29b3-d1a3-4537-8df6-04d0049963d6 return text.upper() @excel_helper(cse_params=0) def value(text): - # Excel reference: https://support.office.com/en-us/article/ + # Excel reference: https://support.microsoft.com/en-us/office/ # VALUE-function-257D0108-07DC-437D-AE1C-BC2D3953D8C2 if isinstance(text, bool): return VALUE_ERROR