I'm calculating range E4:F23. Currently I have this quite lengthy formula where if any cell in my range is empty, I 'm using "0" for my calculation:
=(IFERROR($E4*F4,"0")+IFERROR($E5*F5,"0")+IFERROR($E6*F6,"0")+IFERROR($E7*F7,"0")+IFERROR($E8*F8,"0")+IFERROR($E9*F9,"0")+IFERROR($E10*F10,"0")+IFERROR($E11*F11,"0")+IFERROR($E12*F12,"0")+IFERROR($E13*F13,"0")+IFERROR($E14*F14,"0")+IFERROR($E15*F15,"0")+IFERROR($E16*F16,"0")+IFERROR($E17*F17,"0")+IFERROR($E18*F185,"0")+IFERROR($E19*F19,"0")+IFERROR($E20*F20,"0")+IFERROR($E21*F21,"0")+IFERROR($E22*F22,"0")+IFERROR($E23*F23,"0"))/$E25
I have 2 questions:
1. Even though current formula does what I need, but can this be shortened?
2. Since some of the rows in my range can be hidden using filter, how can I change my formula so will calculate only data from the displayed rows. I was thinking about adding something like SUBTOTAL(9, ....... in front of my formula, but I have no idea how to do it.
Any help will be greatly appreciated.
Regards,
John
=(IFERROR($E4*F4,"0")+IFERROR($E5*F5,"0")+IFERROR($E6*F6,"0")+IFERROR($E7*F7,"0")+IFERROR($E8*F8,"0")+IFERROR($E9*F9,"0")+IFERROR($E10*F10,"0")+IFERROR($E11*F11,"0")+IFERROR($E12*F12,"0")+IFERROR($E13*F13,"0")+IFERROR($E14*F14,"0")+IFERROR($E15*F15,"0")+IFERROR($E16*F16,"0")+IFERROR($E17*F17,"0")+IFERROR($E18*F185,"0")+IFERROR($E19*F19,"0")+IFERROR($E20*F20,"0")+IFERROR($E21*F21,"0")+IFERROR($E22*F22,"0")+IFERROR($E23*F23,"0"))/$E25
I have 2 questions:
1. Even though current formula does what I need, but can this be shortened?
2. Since some of the rows in my range can be hidden using filter, how can I change my formula so will calculate only data from the displayed rows. I was thinking about adding something like SUBTOTAL(9, ....... in front of my formula, but I have no idea how to do it.
Any help will be greatly appreciated.
Regards,
John
Last edited: