Excel - Using IF statement to add 1 to total
On February 18,2022 by Tom RoutleyExcel is used to store, share and analyze data. It has inbuilt formulas that can be customized and combined with each other to achieve the desired results. For example, IF statement incorporates conditional statements. The user can combine IF statement with other functions to add in a conditional statement. These conditions can be based either on some text or numeric value which the formula would automatically check for.
Example
You are trying to get a formula to add + 1 to a total cell based on the word typed. If you type the word 'Duty' in cells B3:B18 then add + 1 to cell B35. If there are 6 entries of duty then 6 should show in B35. However, if there is another word such as 'Leave' then you do not want it to count, you would like those tallied in B36. Is there a way to do this?
Solution
To count how many times the word "Duty" appears in the range B3:B18 use this formula in B35:
=SUM(IF(B3:B18="Duty",1,0))
Confirm this formula by pressing CTRL+Shift+Enter.
Do the same for the word "Leave" in B36 by replacing the word "Duty".
Image: © Unsplash
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply