Best way to add multiple IF formulas.

Cgalla87

New Member
Joined
Nov 29, 2018
Messages
16
Hello,

I am developing a Full Time Employee Headcount tracker for my business. Looking for ideas on best way to add multiple IF formulas. For example, I have a table that has employee name and salary. Next to it I run out 36 months. If that employee is still employed there is a 1 in each of the 36 months, if they left our company it switches to a 0. Now for each month I want to add the total salaries of the company (but ONLY if they are still employed).

Right now I have a bunch of IF(A1>0,A2,0)+IF(B1>0,B2,0)+.....so on for every employee row. obviously, as the company grows I don’t want to have hundreds of IF statements added together. Any thoughts on best way to add individual cells if a different cell in that row is above 0?

Hope that made sense.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Without seeing your data, it is hard to say. But in looking at your formula, I am guessing that SUMIF may be what you want, i.e.
Excel Formula:
=SUMIF(A1:Z1,">0",A2:Z2)

See here for more details on the SUMIF function: MS Excel: How to use the SUMIF Function (WS)
 
Upvote 0
Solution
Hey,

I'd try a SUMPRODUCT formula.

=SUMPRODUCT((A1:AJ1)*(A2:AJ2))

Assuming your 36 columns are spanned from A to AJ
 
Upvote 0

Forum statistics

Threads
1,215,581
Messages
6,125,658
Members
449,247
Latest member
wingedshoes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top