Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Modify formula to display Null

In worksheet #1
Each row contains a unique name like: David, Joe etc. (in column A) and

it's data like: salary etc. (in columns B,C etc.). Last column contains

unique groupName like group1, group2 etc.

In worksheet #2
Each row contains a unique group name like: group1, group2 etc. (in
column A) and calculated data like: groupAverageSalary etc. (in columns

B,C etc.)

In worksheet#2 I calaculate group's data dynamic according to
user input in worksheet#1 (For example: groupAverageSalary for group1
will be calculated as the average salary of all the people who are
members in group1

I used:
=SUMIF(worksheet#1!E1:E15,worksheet#2!A1,worksheet #1!B1:B15)/COUNTIF(worksheet#1!E1:E15,worksheet#2!A1)

My problem:
In case that there no values for some group in worksheet#1 column B
I want to display NULL in worksheet#2 column B (my formula returns 0).

How can I changed my formula to do this ?

worksheet#1
A,B,... ,E
Name, salary, ..., groupName
David, 2000$, ..., group1
Joe, 1000$, ..., group2


worksheet#2
A,B, ...
groupName, averageSalary, ...
group1, 2000$, ...
group2, 1000$

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Modify formula to display Null

try putting an if statement at the beginning, something like,
=if(SUMIF(worksheet#1!E1:E15,worksheet#2!A1,worksh eet#1!B1:B15)/COUNTIF(worksheet#1!E1:E15,worksheet#2!A1)),

(SUMIF(worksheet#1!E1:E15,worksheet#2!A1,worksheet #1!B1:B15)/COUNTIF(worksheet#1!E1:E15,worksheet#2!A1)
), "NULL").

what this says is, if function = "something", then "something", else
"NULL".

my syntax may not be exactly right, but this is the idea that i have
used in the past.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Modify formula to display Null

Hello,

Thank you for your help.

My problem is that I don't know weather the sumif returns zero because
there is no value is the choosen lines or the total sum of choosen
lines values is zero.

For example:

Case 1:
group value
A 0
A

sumif which sums values for group A lines will return: 0

Case 2:
group value
A
A

sumif which sum values for group A lines will return: 0

How can I check wheather all choosen lines are empty ?

Thank you for yor help.
Gil D.

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
How not to display null values (0's and/or #DIV/0!'s? absinthe Excel Discussion (Misc queries) 2 October 9th 08 11:09 PM
De-activating null value display ICTag New Users to Excel 1 June 12th 06 09:31 PM
Modify a Formula to Display Blank carl Excel Worksheet Functions 2 July 13th 05 02:22 PM
PivotTable (blank) cells won't display NULL! Abdul Malik Said Excel Programming 3 March 24th 05 08:32 PM
Find and Display / Modify code Soniya Excel Programming 0 October 12th 04 01:10 PM


All times are GMT +1. The time now is 06:28 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"