IF and conditional sum, one result

P

pboost1

Hello everybody. I am trying to do something with a spreadsheet and no
sure how to work the formula. I have seven columns and seven rows. Th
column starts at F and the rows start and 1. The formula I have i
this:

=IF(SUM(K1:K5)>=30,SUM(K1:K5)-30,IF(SUM(K1:K5)>=20,SUM(K1:K5)-20,IF(SUM(K1:K5)>=10,SUM(K1:K5)-10,IF(SUM(K1:K5)<10,SUM(K1:K5))))


This is in cell K6. I would like this formula to also be able to loo
at cells L6 and L7, and if L7 is larger than L6, subtract 1 from resul
of the formula in K6. Can something like this be done? Thank you i
advance for any help that can be given
 
E

Excel_Geek

Is this it?

=IF(L7>L6,(IF(SUM(K1:K5)>=30,SUM(K1:K5)-30,IF(SUM(K1:K5)>=20,SUM(K1:K5)-20,IF(SUM(K1:K5)>=10,SUM(K1:K5)-10,IF(SUM(K1:K5)<10,SUM(K1:K5))))))-1,IF(SUM(K1:K5)>=30,SUM(K1:K5)-30,IF(SUM(K1:K5)>=20,SUM(K1:K5)-20,IF(SUM(K1:K5)>=10,SUM(K1:K5)-10,IF(SUM(K1:K5)<10,SUM(K1:K5)))))
 
B

Biff

Hi!

If I understand what you want try this:

=IF(SUM(K1:K5)>=30,SUM(K1:K5)-30,IF(SUM(K1:K5)>=20,SUM(K1:K5)-20,IF(SUM(K1:K5)>=10,SUM(K1:K5)-10,IF(SUM(K1:K5)<10,SUM(K1:K5)))))-(L7>L6)

Biff
 
G

Guest

try this. I nested your formula within an if statement.

if (L7>L6,your formula -1, your formula)

=IF(L7>L6,IF(SUM(K1:K5)>=30,SUM(K1:K5)-30,IF(SUM(K1:K5)>=20,SUM(K1:K5)-20,IF(SUM(K1:K5)>=10,SUM(K1:K5)-10,IF(SUM(K1:K5)<10,SUM(K1:K5)))))-1,IF(SUM(K1:K5)>=30,SUM(K1:K5)-30,IF(SUM(K1:K5)>=20,SUM(K1:K5)-20,IF(SUM(K1:K5)>=10,SUM(K1:K5)-10,IF(SUM(K1:K5)<10,SUM(K1:K5))))))
 
B

Biff

Hi!

If I'm following you correctly then you can shorten your formula to:

=IF(SUM(K1:K5)<10,SUM(K1:K5),SUM(K1:K5)-LOOKUP(SUM(K1:K5),{10,10;20,20;30,30}))-(L7>L6)

Biff
 

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