Help with unknown row numbers in SUMIF

jroach15

New Member
Joined
Oct 30, 2014
Messages
1
Hi,

Can anyone tell me what I am doing wrong? I am using the following to sum data in another sheet:

=SUMIF(BOE!$B$1:$B$38,"*("&$A6&")*",BOE!$H$1:$H$38)

This gives me the correct sum but I would like to change it so that I don't have to know the absolute range, namely the row number. Here is he path I started down.

I want to swap out the "Sum Range" field of the SUMIF function above with:

BOE!H&ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0))&":H"&ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0)-ROW(BOE!$A39))




The following formula in a cell by itself gives me a value of 1

=ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0))
This one give me a value of 38:

=ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0)-ROW(BOE!$A39))

When I try to combine them in SUMIF as follows, I get an error:


=SUMIF(BOE!B&ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0))&":B"&ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0)-ROW(BOE!$A39)),"*("&$A6&")*",BOE!H&ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0))&":H"&ABS(MATCH(RIGHT(BOE!$A39,LEN(BOE!$A39)-4),BOE!A:A,0)-ROW(BOE!$A39)))

Obviously I am doing it wrong. How can I fix it?

Thanks in advanced for your help
Jim

 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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