Question: Can we apply a condition on excel?

I need "Remaining Issues" as 0 if "Fixed" is True and "Remaining Issues" as 1 if "Fixed" is False.

[![Kindly refer this image attached](https://i.stack.imgur.com/KLBf0.png)](https://i.stack.imgur.com/KLBf0.png)

Answer: 
How to reduce an array of booleans to a single boolean? Well, it depends upon binary operation you'd like to use. In your case, obviously, `or` is required, thus:

```
arrayOfBools.reduce((res, cur) => res || cur, false)

```

would work even if `arrayOfBools` is empty (`false` is default value returned in that way, which is logically correct).

How to reduce an array of arrays to a single array, i.e. how to flatten "higher order array" with `reduce`?

```
higherOrderArray.reduce((res, cur) => res.concat(cur), [])

```

That will do.

Now you can flatten your array of arrays of bools to a single flat array of bools and reduce it to a single bool. Note that classic loop will be much more efficient.

The other way is to flat your higher order array differently, using `map`. You could map your array of arrays of booleans to array of booleans using above mentioned `or`-drived `reduce` and `reduce` it one more time.

Functional implementation would be:

```
const mapReduce = <TSource, TTarget, TReduced>
(map: (x: TSource) => TTarget) =>
    (reduce: (res: TReduced, cur: TTarget) => TReduced) =>
        (zero: TReduced) =>
            (arr: TSource[]) : TReduced => {
return !arr || !arr.length ? zero : arr.map(map).reduce(reduce, zero)

```

} 

P.S. I wouldn't suggest to let such code leak into your prod unless your team is absolutely fine with functional programming. It just servers for learning purposes.
```
let arrBefore = [true, false, false],[false, false, false],[true, false, true],[true, false, true]]

let arrAfter = []

arrBefore.forEach((item) => {
  arrAfter.push(!!item.find((i) => i === true))
})

console.log(arrAfter) 

// [true, false, true, true]

```