Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello
I am trying to find a way to use SUMIF with OFFSET on a range of variable length. My data is organized in this manner: Each row represents one fee charged to a client on a particular date. Column E contains the names of the fees that are charged. Each client has at least one entry for Fee1 through Fee5. The number of rows for any particular client may increase during the year. A blank row will separate clients from each other (Row 18 in this example). There may be more than one blank row between clients. Rows 9 - 17 represent fees charged to one client (Client 1). Rows 19 - 23 represent the fees charged to the next client (Client 2). Column F in each row may have an entry or it may be blank. Col E Col F Row 9 Fee1 10 Row 10 Fee2 20 Row 11 Fee3 30 Row 12 Fee4 40 Row 13 Fee5 50 Row 14 Fee1 10 Row 15 Fee4 Row 16 Fee1 Row 17 Fee2 20 Row 18 blank Row 19 Fee1 10 Row 20 Fee2 20 Row 21 Fee3 30 Row 22 Fee4 40 Row 23 Fee5 50 I am trying to create a formula to add up all of the Fee1 charges for Client 1. Since the number of rows for Client 1 will vary, I am trying to use the MATCH function to identify the number of rows associated with Client 1 by looking for the first blank cell in Column E at the bottom of the data for each client. The following formula gives a #REF! error. When I step through the formula, the two OFFSET functions appear to show the correct inputs of OFFSET(E9, 0, 0, 9, 0) and OFFSET(F9, 0, 0, 9, 0), but each one individually gives the #REF! error. The value in cell E9 is the text string "Fee1". The total of Fee1 for Client 1 should be 20 in this example. =SUMIF(OFFSET(E9, 0, 0, MATCH(TRUE,INDEX(ISBLANK(E9:E60),0,0),0)-1, 0), E9, OFFSET(F9, 0, 0, MATCH(TRUE,INDEX(ISBLANK(E9:E60),0,0),0)-1, 0)) According to the Excel help, #REF! errors mean that the OFFSET goes beyond the edges of the worksheet, but I don't think I am doing this. Any help would be gratefully appreciated, either in fixing this formula or offering a better solution. Whatever formula I use will need to be copied down for several hundred clients. Thank you in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul | Excel Worksheet Functions | |||
SUMIF/OFFSET Query | Excel Worksheet Functions | |||
Trying to use sumif and offset functions | Excel Discussion (Misc queries) | |||
offset? match index? sumif? 2way look-up? | Excel Worksheet Functions | |||
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function | Excel Worksheet Functions |