Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Map-like array function in Excel?

Is there something like a map function in Excel?

For example, let’s say I want to apply the formula ABS to a list of items. Something like:

=ABS,{-1,2,3,4,5}

As an example of python-like notation:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

# list comprehension
>>> [abs(i) for i in [-1,2,3,4,5]]
[1, 2, 3, 4, 5]

# map
>>> map(abs,[-1,2,3,4,5])
[1, 2, 3, 4, 5]

# passing arbitrary function
>>> map(lambda x:abs(x)+1, [-1,2,4,5,6])
[2, 3, 5, 6, 7]

Is there something similar in Excel?


Note, the closest I’ve gotten is using native operators against lists, such as =2*{1,2,3,4,5}, but this just gives things like the basic arithmetic operations.

>Solution :

In Excel-365 you can directly use ABS() function with array of data. Try-

=ABS({-1,2,3,4,5})

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading