Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Combine an "IF" and "OR" statement

I need to calculate the % difference between 2 years of sales, however one
year or the other may be a zero value (ie new customer this year or old one
last year that has no sales this year). Zero sales last year with sales this
year = 100% or sales last year with zero sales this year = -100%, or if there
are sales in both years calculate the % difference.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default Combine an "IF" and "OR" statement

Hi

Assuming your data is in column A and B, In C1
=IF(COUNT(A1:B1)<2,"n/a",B1/A1*100)

This will put n/a in the cell if either (or both) year(s) has no value
Change the "n/a" to "" if you want a blank cell to appear.
--
Regards
Roger Govier

"Picman" wrote in message
...
I need to calculate the % difference between 2 years of sales, however one
year or the other may be a zero value (ie new customer this year or old
one
last year that has no sales this year). Zero sales last year with sales
this
year = 100% or sales last year with zero sales this year = -100%, or if
there
are sales in both years calculate the % difference.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Combine an "IF" and "OR" statement

On Fri, 2 Jan 2009 09:22:00 -0800, Picman
wrote:

I need to calculate the % difference between 2 years of sales, however one
year or the other may be a zero value (ie new customer this year or old one
last year that has no sales this year). Zero sales last year with sales this
year = 100% or sales last year with zero sales this year = -100%, or if there
are sales in both years calculate the % difference.


Last year in column A, this year in column B.

Try this formula in e.g. column C:

=IF(A1=0,100%,IF(B1=0,-100%,(B1-A1)/A1*100%))

Hope this helps / Lars-Åke

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Combine an "IF" and "OR" statement

That worked great, thank you very much.

"Lars-Ã…ke Aspelin" wrote:

On Fri, 2 Jan 2009 09:22:00 -0800, Picman
wrote:

I need to calculate the % difference between 2 years of sales, however one
year or the other may be a zero value (ie new customer this year or old one
last year that has no sales this year). Zero sales last year with sales this
year = 100% or sales last year with zero sales this year = -100%, or if there
are sales in both years calculate the % difference.


Last year in column A, this year in column B.

Try this formula in e.g. column C:

=IF(A1=0,100%,IF(B1=0,-100%,(B1-A1)/A1*100%))

Hope this helps / Lars-Ã…ke


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Combine an "IF" and "OR" statement

Hi,

If you will never have both years without sales, then try this

=IF(A1,(B1-A1)/A1,1)

Where A1 is the old year sale's and B1 the new year's sales

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Picman" wrote:

I need to calculate the % difference between 2 years of sales, however one
year or the other may be a zero value (ie new customer this year or old one
last year that has no sales this year). Zero sales last year with sales this
year = 100% or sales last year with zero sales this year = -100%, or if there
are sales in both years calculate the % difference.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Combine logical formulas "if", "and", "or" pscu Excel Discussion (Misc queries) 5 November 2nd 06 07:43 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"