IF Function

  • Thread starter Thread starter cheetah
  • Start date Start date
C

cheetah

Hi:

I need help with the following function:

if sum(P138*AC138/100)>0
then I want that sum (P138*AC138)
otherwise sum(AO138:AT138)

I don't know if this makes a difference; however, the calc in AC138 is
=(1-((AI138+AK138)/AV138))*AV138/P138*1000
which returns #DIV/0! because P is entered as zero which is correct
because that field is not relevant to that account.

If this is not clear I can try to provide more detail.

Thanks
cheetah
 
You can change this formula:

=(1-((AI138+AK138)/AV138))*AV138/P138*1000

to this:

=IF(P138=0,0,(1-(AI138+AK138)/AV138)*AV138/P138*1000)

to avoid the #DIV/0 error. Then the other formula you want becomes:

=IF(P138*AC138/100>0,P138*AC138,SUM(AO138:AT138))

Hope this helps.

Pete
 
You can change this formula:

=(1-((AI138+AK138)/AV138))*AV138/P138*1000

to this:

=IF(P138=0,0,(1-(AI138+AK138)/AV138)*AV138/P138*1000)

to avoid the #DIV/0 error. Then the other formula you want becomes:

=IF(P138*AC138/100>0,P138*AC138,SUM(AO138:AT138))

Hope this helps.

Pete
 
Pete_UK said:
You can change this formula:

=(1-((AI138+AK138)/AV138))*AV138/P138*1000

to this:

=IF(P138=0,0,(1-(AI138+AK138)/AV138)*AV138/P138*1000)

to avoid the #DIV/0 error. Then the other formula you want becomes:

=IF(P138*AC138/100>0,P138*AC138,SUM(AO138:AT138))

Hope this helps.

Pete

Worked perfectly!
Thank you to all who replied.
cheetah
 
Pete_UK said:
You can change this formula:

=(1-((AI138+AK138)/AV138))*AV138/P138*1000

to this:

=IF(P138=0,0,(1-(AI138+AK138)/AV138)*AV138/P138*1000)

to avoid the #DIV/0 error. Then the other formula you want becomes:

=IF(P138*AC138/100>0,P138*AC138,SUM(AO138:AT138))

Hope this helps.

Pete

Worked perfectly!
Thank you to all who replied.
cheetah
 

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

Back
Top