Computing.Net > Forums > Office Software > Adding up sells with an if statemen

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Adding up sells with an if statemen

Reply to Message Icon

Name: bwdeikken
Date: August 20, 2008 at 15:54:36 Pacific
OS: Excel 2003
CPU/Ram: lots
Product: not sure
Comment:

Ok I am working on an excel spread sheet to collect data from 3 shifts. In column D the shift is listed such as 1A, 2B, and 3C and the totals are listed in column AC. Now I would like to average them out by shift. Here is the if statement i tried to use.
I would like the data for 1A to show in field AF2 and 2b to show up in Af3 and 3C to show up in AF4.

=IF(D:D="1A",AF2= AF2 +AC:AC,AF2)

This is just for the 1A shift.



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: August 20, 2008 at 21:05:55 Pacific
Reply:

If what you want to do is add up the values in column AC associated with a particular value in column D, then you probably want to use the SUMIF function.

Per the Excel help files, the syntax is as follows:

SUMIF(range,criteria,sum_range)

In your case, for 1A, I believe you should put this in AF2 (which, BTW, is a cell not a field):

=SUMIF(D:D,"=1A",AC:AC)

If you want the average of the values in AC associated with 1A, you have a couple of options.

You can divide the sum of the values associated with 1A by the number of values associated with 1A:

=SUMIF(D:D,"=1A",AC:AC)/COUNTIF(D:D,"=1A")

or you can use an array formula such as:

{=AVERAGE(IF(D1:D25="1A",AC1:AC25))}

2 notes:

1- You have to specify a specific range for the array, e.g. D1:D25. You can't use D:D or AC:AC.

2 - You enter the formula by using Ctrl-Shift-Enter to get the brackets and make it an array formula. You can't just type in the {} and expect it to work. If you just hit Enter, you may get an answer, but it won't be correct.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Adding up sells with an if statemen

excel using an if statement with a list? www.computing.net/answers/office/excel-using-an-if-statement-with-a-list/8645.html

Help with excel if statements www.computing.net/answers/office/help-with-excel-if-statements/6834.html

Sum a variable range of cells?? www.computing.net/answers/office/sum-a-variable-range-of-cells/6931.html