Pixel Art Health Bar in Excel | A Surprising Use For Recursive LAMBDA() Functions

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • This covers how to use HSTACK recursively to generate an array of arrays. In this context, doing some very silly pixel art to make a retro video game style health bar using conditional formatting. There may be legitimate uses for this, I don't know, I'm just here to annoy proper programmers by doing wileird things that this cursed accountancy software was definitely not designed to do.
    If there's another solution to doing something like this, I'd be interested to see it. I tried various combinations of REPT() anf SEQUENCE() to see what happens, but stacking arrays seemed the way to do it. Besides, it's good practice for loops.
    There is an issue with what happens when the value is "0". How do you effectively get it to return a null? There are probably 3-4 solutions for this (another escape out of the loop with an additional IF() would do it), but I've included what I think is the fastest and easiest one that doesn't return an error. It's a little bit of a hack, but it functions. Better solutions welcome.
    Excercise left to the reader: How would you modify this so that the highest block was a different shape, or brighter? Can we layer conditional formatting to get more than one colour?
  • НаукаНаука

Комментарии •