If than Else Trouble

G

Goofy

I need help with a spreadsheet that is used to calculate a companies
forecast. How this works is during a month a spreadsheet calculates the
hours worked to get a financial forecast.We put on there planned weeks hours
and than fill in at the end of the week the actual hours.

This is a spreadsheet where you add the actual columns (these are the weeks
that have happened) that occurred with the forecasted columns. (These are
the columns that have not occurred.

(Example)
If the 1a is filled and is the only (a) column filled than you calculate the
1a+2+3+4 columns
If the 1a and the 2a is filled than you calculate the 1a+2a+3+4 columns
If the 1a and the 2a and the 3a is filled than you calculate the 1a+2a+3a+4
columns


Attempted with no success below. I tried to work backwards to see what week
we were in and than calculate accordingly.
----------------------------------------------------------------
Column 1, 1a, 2, 2a, 3, 3a, 4, 4a

If column 4a > 0 than add column 4a+3a+2a+1a

else add column 1a+2a+3a+4
 
M

Max

One way ..

A sample construct is available at:
http://www.savefile.com/files/1481398
Sum_AlternateCols_Goofy_wks.xls

Assuming the cols: 1, 1a, 2, 2a ... 4a are cols A to H
with data from row2 down

Put in say, the formula bar for I2:
=SUM(IF(--(MOD(COLUMN(A2:H2),2)=0),A2:H2))
+IF(ISNA(MATCH(1,--(A2:H2=""),0)),0,
SUM(OFFSET(H2,,,,MATCH(1,--(A2:H2=""),0)-10)))

Array-enter the formula, i.e. press CTRL+SHIFT+ENTER
(instead of just pressing ENTER)
Copy I2 down
 
R

Roger Govier

Hi

One way, though perhaps not the most elegant
=SUM(A2:H2)-SUM(A2*(B2>0),C2*(D2>0),E2*(F2>0),G2*(H2>0))
 

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

Similar Threads


Top