How to +1 using IF, IFS, SWITCH
I am currently trying to do a for a spreadsheet where each time a type of the same incident occurs, 1 is added to the correlating cell. I am struggling to achieve this. I have tried an IFS and SWITCH but neither work, I keep getting the same error.
=IFS(A5="Animals",B5+1,A5="Appliances",B5+1,A5="Electricity",B5+1,A5="Fire",B5+1,A5="Heating",B5+1,A5="Lifts",B5+1, A5="Property Damage",B5+1,A5="Water",B5+1, A5="Other",B5+1)
=SWITCH(A5,A5="Animals",B5+1,A5="Appliances",B5+1,A5="Electricity",B5+1,A5="Fire",B5+1,A5="Heating",B5+1,A5="Lifts",B5+1,A5="Property Damage",B5+1,A5="Water",B5+1,A5="Other",B5+1)
It keeps saying inconsistent error. If I add equal signs in front it completely breaks. If I take the B5 out they are all "1". If I keep it in they are all "0". I just want to make a tally. Can someone help please?
Example of what I am trying to achieve
Excel is version 2603 build 19822.20182
EDIT 1 - SOLVED but feel free to add feedback. Solution ended up as: =IFS(A13="Animals",COUNTIF($A$4:A13,"Animals"),A13="Appliances",COUNTIF($A$4:A13, "Appliances"),A13="Electricity",COUNTIF($A$4:A13,"Electricity"),A13="Fire",COUNTIF($A$4:A13,"Fire"),A13="Heating",COUNTIF($A$4:A13,"Heating"), A13="Lifts",COUNTIF($A$4:A13,"Lifts"),A13="Property Damage",COUNTIF($A$4:A13,"Property Damage"),A13="Water",COUNTIF($A$4:A13,"Water"),A13="Other",COUNTIF($A$4:A13,"Other")) If you can make it tidier be my guest :)
[link] [comments]
Want to read more?
Check out the full article on the original site