1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How to +1 using IF, IFS, SWITCH

Our take

If you're looking to create a tally of incidents in your spreadsheet, using the right functions can make all the difference. The challenge often comes when trying to increment counts based on specific conditions. In your case, the IFS and SWITCH functions may not yield the desired outcomes due to their structure. Instead, leveraging the COUNTIF function can provide a more effective solution for counting occurrences of each incident type. This approach simplifies the process and ensures accurate tallies as you log each incident.

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 :)


submitted by /u/Advanced-Jelly3774
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Tagged with

#Excel alternatives for data analysis#Excel compatibility#Excel alternatives#rows.com#natural language processing for spreadsheets#modern spreadsheet innovations#machine learning in spreadsheet applications#generative AI for data analysis#enterprise-level spreadsheet solutions#digital transformation in spreadsheet software#collaborative spreadsheet tools#AI-driven spreadsheet solutions#cloud-based spreadsheet applications#real-time data collaboration#automation in spreadsheet workflows#no-code spreadsheet solutions#AI-powered spreadsheet#real-time collaboration#spreadsheet API integration#IFS