Consolidate Multiple IF Cell Contains Sum Formula

lsab

New Member
Joined
Aug 16, 2012
Messages
16
I've created a formula to check if a cell contains "3". If it does contain "3" then it returns the value of a cell located 2 rows down.
I've then duplicated this formula using + so it can add the values of all the cells found that contain "3".

The formula is:
=IF(ISNUMBER(SEARCH("3",'Block 1'!E9)),'Block 1'!E11,)+IF(ISNUMBER(SEARCH("3",'Block 1'!E13)),'Block 1'!E15,)+IF(ISNUMBER(SEARCH("3",'Block 1'!E17)),'Block 1'!E19,)+IF(ISNUMBER(SEARCH("3",'Block 1'!E21)),'Block 1'!E23,)

I need to consolidate this as currently it only searches 4 cells, I in fact need to to search and add 55 cells.

Is it possible to consolidate this formula into something a little more elegant?


Many Thanks.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi,

I'm assuming that the entries in the cells in between those which you wish to consider may also contain e.g. "3", so that we need to restrict the formula to looking at every fourth cell only (otherwise the solution would be simplified somewhat):

=SUMPRODUCT((ISNUMBER(SEARCH("3",T(OFFSET('Block 1'!E9,4*(ROW($1:$100)-1),,,))))*N(OFFSET('Block 1'!E11,4*(ROW($1:$100)-1),,,))))


Change the $100 to a sufficiently higher number if required (as it stands, the formula will suffice up to cell E407).

Note also that row insertions within this range would compromise this formula. Let me know if that is something which you would like to have the option of doing and I will tweak the formula accordingly.

Regards
 
Last edited:
Upvote 0
I've created a formula to check if a cell contains "3". If it does contain "3" then it returns the value of a cell located 2 rows down.
I've then duplicated this formula using + so it can add the values of all the cells found that contain "3".

The formula is:
=IF(ISNUMBER(SEARCH("3",'Block 1'!E9)),'Block 1'!E11,)+IF(ISNUMBER(SEARCH("3",'Block 1'!E13)),'Block 1'!E15,)+IF(ISNUMBER(SEARCH("3",'Block 1'!E17)),'Block 1'!E19,)+IF(ISNUMBER(SEARCH("3",'Block 1'!E21)),'Block 1'!E23,)

I need to consolidate this as currently it only searches 4 cells, I in fact need to to search and add 55 cells.

Is it possible to consolidate this formula into something a little more elegant?


Many Thanks.

Just enter:
Rich (BB code):
=SUMPRODUCT(
  --(MOD(ROW('Block 1'!E9:E27)-ROW('Block 1'!E9),4)=0),
  --ISNUMBER(SEARCH(3,'Block 1'!E9:E27)),'Block 1'!E11:E29)

Note that 2 cell difference between E9:E27 and E11:E29.
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,127
Members
452,381
Latest member
Nova88

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