# Thread: Auto sum

1. Dear All,

I have the following attached table.
I want to create a macro to do automatically sum the values from the first sheet into the second sheet.
A function to search the data where I have the: "A, A1, B, B1...." to sum the values into the second sheet as is in the example.

I thing to search for the name A1 .... and the left cell of the cell with name to sum into the sheet 2.

Best regards,
Marius

2. I'd enter the contract names A, A1 etc. in column A on Sheet2. In the attached version, I've used a custom format "Contract "@ to display Contract A, Contract A1 etc.

You can then use the following array formula (confirm with Ctrl+Shif+Enter) in B6:

=SUM(IF(Sheet1!\$D\$9:\$P\$19=A6,Sheet1!\$C\$9:\$O\$19))

and fill down to B17.

3. [quote name='HansV' post='772184' date='24-Apr-2009 20:00']I'd enter the contract names A, A1 etc. in column A on Sheet2. In the attached version, I've used a custom format "Contract "@ to display Contract A, Contract A1 etc.

You can then use the following array formula (confirm with Ctrl+Shif+Enter) in B6:

=SUM(IF(Sheet1!\$D\$9:\$P\$19=A6,Sheet1!\$C\$9:\$O\$19))

and fill down to B17.[/quote]

Thanks, is what i need.

4. For a single conditional sum, SUMIF function appeared better/faster than SUM+IF in combined

B6, enter the formula and copied down :

=SUMIF(Sheet1!D\$9:P\$19,A6,Sheet1!C\$9)

Regards
Bosco

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•