Search code examples
google-sheetsgoogle-sheets-formula

Google Sheets 2 cells with identical functions, one is true, one is false; why?


Normal Behavior

I am creating a spreadsheet to track character builds in D&D 5e. I am trying to have the cells below "Barbarian Unarmored Defense" and "Monk Unarmored Defense" check for values in the lower ranges, then return a blank if they are filled or levels in their corresponding class are not taken. The Monk one works fine with the formula designed, seen here; enter image description here

enter image description here

The exact same formula in the next cell returns differently

enter image description here

enter image description here

Markdown Table

A1 Scores B1 Strength C1 Dexterity D1 Constitution E1 Intelligence F1 Wisdom G1 Charisma H1 I1 Core J1 Level K1 Proficiency L1 Per Rest Class Resources M1 N1 O1 P1
A2 Base 8 10 10 10 16 10 10 4 Artificer Prepared Spells Barbarian Rage Rage Damage Bardic Inspiration Song of Rest
A3 Adjust Spell Slots Pact Slots 3 +2
A4 Mod Adjust Blood Curses & Hemocraft Die Cleric Prepared Spells Channel Divinity<br>(Cleric/Paladin) Druid Prepared Spells Wild Shapes (Druid)
A5 Mod -1 =IF((SIGN(ROUNDDOWN((C2-10+C3)/2+C4))<0), ROUNDDOWN((C2-10+C3)/2+C4), "+" & ROUNDDOWN((C2-10+C3)/2+C4)) +0 +0 =IF((SIGN(ROUNDDOWN((F2-10+F3)/2+F4))<0), ROUNDDOWN((F2-10+F3)/2+F4), "+" & ROUNDDOWN((F2-10+F3)/2+F4)) +0
A6 Save -1 +0 +0 +0 +3 +0 Indomitable<br>(Fighter) Sneak Attack<br>(Rogue) Ki Points<br>(Monk) Martial Arts Dice Unarmored Movement (Monk)
A7 Proficient? 5 1d6 10ft
A8 Expert? Paladin Prepared Spells Favored Foe<br>(Ranger) Nature's Veil<br>(Ranger) Sorcery Points Arcane Recovery
A9
A10 Stats Current HP Max HP AC Class Levels Artificer Barbarian Arcane Trickster Levels Eldritch Knight Levels Eldritch Invocations Mystic Arcanum 6th Mystic Arcanum 7th Mystic Arcanum 8th
A11 Base 0 13 5
A12 Adjust Bard Blood Hunter Cleric Barbarian Unarmored Defense Monk Unarmored Defense
A13 Temp Effect =IF(OR(ISBLANK($H$15), NOT(ISBLANK(I19:M19)), NOT(ISBLANK(J16:P16))), "", 10+$F$5+$C$5) =IF(OR(ISBLANK($H$15), NOT(ISBLANK(I19:M19)), NOT(ISBLANK(J16:P16))), "", 10+$F$5+$C$5) 13 0 0
A14 Druid Fighter Monk Mage Armor Padded/Leather Armor Studded Leather Armor Hide Armor Chain Shirt Scale Mail / Spiked Armor Breastplate
A15 Level Rolled HP Level 5
A16 1 Always Max 11 Paladin Ranger Rogue
A17 2 12 Ring Mail Chain Mail Splint Plate Shield Custom Custom
A183 13 Sorcerer Warlock Wizard Requires 13 STR Requires 15 STR Requires 15 STR
A19 4 14
A20 5 15
A216 16 Subclass Select
A22 7 17 Artificer Barbarian Bard Blood Hunter Cleric Druid Fighter Monk Paladin Ranger
A23 8 18
A24 9 19
A25 10 20
A26

Troubleshooting & Spreadsheet Link

The exact same formula works in the cell next to it, with all the same cell addresses and everything... so I expected them to output the same value. Steps I have taken to troubleshoot, reverting each after attempt;

  • Changes to the ranges or cell IDs at all continues to return an empty cell If I change the true condition--that is always output, regardless of whether the other cells are filled or blank

  • Changes to the false condition are never output, regardless of whether the other cells are filled or blank

  • Emptying or filling H15 does not affect the output of I13's function


Solution

  • You need to array-enable your current formula as such:

    =arrayformula(IF(OR(ISBLANK($H$15), NOT(ISBLANK(I19:M19)), NOT(ISBLANK(J16:P16))), "", 10+$F$5+$C$5))
    
    • the reason being a simple NOT(ISBLANK(J16:P16)) does not automatically apply to the whole range of J16:P16; if you are applying this formula in Column J(any possible row) it picks only J16 as the target cell. if applied in Column_L then target cell is L16 and so on...
    • Since Barbarian Unarmored Defenseis outside the zone (as highlighted in the screenshot) it evalutes to TRUE and the output results to blank

    enter image description here