Forum Discussion
Excel
Jul 12, 2021Iron Contributor
Set in a whole number with the help of formulas
Hello Everyone, if there are numbers in a column like [1, 2, 3, 23, 43, 54, 34 +1, 45 - 1, 42 *2 , 34, 98] how to make this a list of whole numbers or how do we calculate in between if there is a ...
- Jul 12, 2021
It would be very complicated without VBA.
HansVogelaar
Jul 12, 2021MVP
See the attached version (now a macro-enabled workbook since it contains a custom VBA function).
Excel
Jul 12, 2021Iron Contributor
Sir, is this possible to solve only function?
- SergeiBaklanJul 12, 2021Diamond Contributor
Exactly the same if you define in name manager named function as
but the file also shall be saved as macro-enabled workbook.
- HansVogelaarJul 12, 2021MVP
It would be very complicated without VBA.
- ExcelJul 12, 2021Iron ContributorOk, Thank you so much sir
- SergeiBaklanJul 12, 2021Diamond Contributor
As another variant formula could be
=LET(str, A1, op, {"+","-","~*","/"}, r, MMULT(COUNTIFS(str,"*"&op&"*"),{1;2;3;4}), pos, SUM(IFERROR(SEARCH(op,str),0)), lft, LEFT(str, pos-1), rht, RIGHT(str, LEN(str)-pos), IF(r=0, str, CHOOSE(r, lft+rht, lft-rht, lft*rht, lft/rht)) )