Use Excel to make a complex IF function.

G

Guest

I am trying to compose an IF function to automatically move hours around a
spread sheet. There are 5-10 areas designated by 2 letter abbreviations and
the hours need to be added to those respective areas. This is what I have so
far,

=IF(E2="ex",+D2)

is there anyway to make where is says E2 to be able to read a column
section, say E2 through E10 and wherever there is the "ex" in that column it
will add to the cell the formula is in? Any help would be appreciated. Jason
 
B

Biff

Hi!

See if this is what you had in mind:

=SUMIF(E2:E10,"ex",D2:D10)

It will sum the values in D2:D10 if the corresponding cell in E2:E10 equals
"ex".

Biff
 
G

Guest

Unfortunately not. I need it to read the section and wherever the "ex" is it
will take the number in the previous column and add it to the total only. I
am using this to track project hours for the company I work for. I figured
out this much last night for one section:

=SUM(C6-D6)+(IF(E2="csmt",+D2))+(IF(E3="csmt",+D3))+(IF(E4="csmt",+D4))+(IF(E5="csmt",+D5))

so wherever csmt shows up it will take the number in the previous column and
add it to this total. I can keep nesting this formula but I was wondering if
there is an easier way to do it besides typing each cell in manually. Mainly
because there is aprox. 1500 employees in each section and the formula will
become quite huge.
 
P

Pete_UK

This formula will do exactly what your (long-winded) one does:

=C6-D6+SUMIF(E2:E5,"csmt",D2:D5)

Perhaps you can see how to modify it for larger ranges.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top