![]() |
IF and THEN statements
I'm currently working on a spreadsheet that is becoming more complicated in
formula needs than I can manage on my own. I was wondering if someone would be kind enough to assist me with a solution on how to incorporate IF and THEN statements. Current Problem: I have this: #DIV/0! showing up in some of my cells currently because there are no numbers to calculate. The results are basically zero. However, I would like it to show that IF the formula results in ZERO, THEN place a 0 instead of the #DIV/0! text in the cell. The current formula in the cell is: =SUM(L16/'2008'!G16 My Question: How do I use an IF and THEN statement with the above formula to place a zero number in the cell if there are no numbers to calculate? Thank you so much in advance for being a help to me. -- Always Learning |
IF and THEN statements
Hi,
Try this and note there's no need for SUM =IF('2008'!G16<0,L16/'2008'!G16,0) Mike "Athena" wrote: I'm currently working on a spreadsheet that is becoming more complicated in formula needs than I can manage on my own. I was wondering if someone would be kind enough to assist me with a solution on how to incorporate IF and THEN statements. Current Problem: I have this: #DIV/0! showing up in some of my cells currently because there are no numbers to calculate. The results are basically zero. However, I would like it to show that IF the formula results in ZERO, THEN place a 0 instead of the #DIV/0! text in the cell. The current formula in the cell is: =SUM(L16/'2008'!G16 My Question: How do I use an IF and THEN statement with the above formula to place a zero number in the cell if there are no numbers to calculate? Thank you so much in advance for being a help to me. -- Always Learning |
IF and THEN statements
If you are just dividing two numbers, you don't need to use SUM. Your IF
formula should check the number by which you are dividing. If it's zero, return zero; otherwise, go ahead and do the division. =IF('2008'!G16=0,0,L16/'2008'!G16) Hope this helps, Hutch "Athena" wrote: I'm currently working on a spreadsheet that is becoming more complicated in formula needs than I can manage on my own. I was wondering if someone would be kind enough to assist me with a solution on how to incorporate IF and THEN statements. Current Problem: I have this: #DIV/0! showing up in some of my cells currently because there are no numbers to calculate. The results are basically zero. However, I would like it to show that IF the formula results in ZERO, THEN place a 0 instead of the #DIV/0! text in the cell. The current formula in the cell is: =SUM(L16/'2008'!G16 My Question: How do I use an IF and THEN statement with the above formula to place a zero number in the cell if there are no numbers to calculate? Thank you so much in advance for being a help to me. -- Always Learning |
IF and THEN statements
IF functions create routes for TRUE/FALSE outcomes. In your case, since
'2008'!G16 is the possible trouble maker, we'll check it first to determine our outcome: =IF('2008'!G16=0,0,L16/'2008'!G16) Note that there is no need for the SUM function, as you are not actually summing an array of numbers, but rather performing a single math operation. -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Athena" wrote: I'm currently working on a spreadsheet that is becoming more complicated in formula needs than I can manage on my own. I was wondering if someone would be kind enough to assist me with a solution on how to incorporate IF and THEN statements. Current Problem: I have this: #DIV/0! showing up in some of my cells currently because there are no numbers to calculate. The results are basically zero. However, I would like it to show that IF the formula results in ZERO, THEN place a 0 instead of the #DIV/0! text in the cell. The current formula in the cell is: =SUM(L16/'2008'!G16 My Question: How do I use an IF and THEN statement with the above formula to place a zero number in the cell if there are no numbers to calculate? Thank you so much in advance for being a help to me. -- Always Learning |
IF and THEN statements
Try it like this:
=IF('2008'!G16=0,0,L16/'2008'!G16) -- Biff Microsoft Excel MVP "Athena" wrote in message ... I'm currently working on a spreadsheet that is becoming more complicated in formula needs than I can manage on my own. I was wondering if someone would be kind enough to assist me with a solution on how to incorporate IF and THEN statements. Current Problem: I have this: #DIV/0! showing up in some of my cells currently because there are no numbers to calculate. The results are basically zero. However, I would like it to show that IF the formula results in ZERO, THEN place a 0 instead of the #DIV/0! text in the cell. The current formula in the cell is: =SUM(L16/'2008'!G16 My Question: How do I use an IF and THEN statement with the above formula to place a zero number in the cell if there are no numbers to calculate? Thank you so much in advance for being a help to me. -- Always Learning |
IF and THEN statements
Let's start with =SUM(L16/'2008'!G16)
There is no need to use SUM when you are doing a simple math operation like divide This is what you need =L16/'2008'!G16 We use SUM as in =SUM(A1:A100) to sum all the vlaues in a range Now let's get that zero =IF('2008'!G16=0, 0, L16/'2008'!G16) or =IF(ISERR(L16/'2008'!G16),0,L16/'2008'!G16) But is zero really what you need? Maybe a cell that looks empty would be better =IF('2008'!G16=0, "" L16/'2008'!G16) That is a pair of double-quotes with nothing between best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Athena" wrote in message ... I'm currently working on a spreadsheet that is becoming more complicated in formula needs than I can manage on my own. I was wondering if someone would be kind enough to assist me with a solution on how to incorporate IF and THEN statements. Current Problem: I have this: #DIV/0! showing up in some of my cells currently because there are no numbers to calculate. The results are basically zero. However, I would like it to show that IF the formula results in ZERO, THEN place a 0 instead of the #DIV/0! text in the cell. The current formula in the cell is: =SUM(L16/'2008'!G16 My Question: How do I use an IF and THEN statement with the above formula to place a zero number in the cell if there are no numbers to calculate? Thank you so much in advance for being a help to me. -- Always Learning |
All times are GMT +1. The time now is 10:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com