More than 7 arguments in an "IF" formula

marcie

New Member
Joined
Oct 1, 2006
Messages
2
=IF(D$14=7,EE20,IF(D$14=8,EE20+ET20,IF(D$14=9,EE20+ET20+FI20,IF(D$14=10,EE20+ET20+FI20+FX20,IF(D$14=11,EE20+ET20+FI20+FX20+GM20,IF(D$14=12,EE20+ET20+FI20+FX20+GM20+HB20))))))


This is what I have so far. D14 refers to a fiscal month (the user enters 1 for Feb etc). EE20 would represent Feb sales. I need to enter if's for the whole year-help.

Thanks
Marcie
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi Marcie and welcome to MrExcel!

Here's another way of doing this without using an IF formula. Try the following formula:

=SUMPRODUCT(N(INDIRECT({"EE20","ET20","FI20","FX20","GM20","HB20"})),--({1,2,3,4,5,6}<=D14))

As you add more cell references in the first array (ie after "HB20") then add additional month numbers into the second array (ie after 6) - each array must have the same number of values for this to work.

Andrew
 

Forum statistics

Threads
1,141,937
Messages
5,709,432
Members
421,636
Latest member
kelseyacheson

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
Top