Solved

Adding conditions to a formula in excel

Posted on 2011-02-24
11
275 Views
Last Modified: 2012-05-11
I have a formula in a cell on a worksheet that is =SUM(D18:D46)/COUNT(D18:D46) and it give me a pecentage. Basically I am using this as a quality rating. What I would like to know how to do it make it to where cell reads incomplete until there is data in all the fields it looks at. I would like to have it, if the certain cell is not relevent for a particular area to be able to put N/A in the cell and have the formula ignor it but if the field is empty to treat it like a 0 so it will have an impact on the final percentage. Quality-RCI-Assessment-Tool-ES.xls
0
Comment
Question by:jlcannon
  • 5
  • 4
  • 2
11 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 34973894
=IF(COUNT(D18:D46)=0,"Incomplete",SUM(D18:D46)/COUNT(D18:D46))

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 34973908
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34973938
I think that if you want to count blanks as zero then you can divide by the count of non N/A cells, try this version in D14 copied across

=IF(COUNTA(D18:D46),SUM(D18:D46)/COUNTIF(D18:D46,"<>N/A"),"")

regards, barry
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34973983
...my suggestion will give you 85% for column D because it's counting blanks as zeroes.....if you want "incomplete" rather than a blank then put that in place of "" in my suggestion, i.e.

=IF(COUNTA(D18:D46),SUM(D18:D46)/COUNTIF(D18:D46,"<>N/A"),"incomplete")

barry
0
 

Author Comment

by:jlcannon
ID: 34974174
@ barryhoudini when I use =IF(COUNTA(D18:D46),SUM(D18:D46)/COUNTIF(D18:D46,"<>N/A"),"incomplete") it returns "TRUE" in the box

@zorvek this still returns 100% for me. I am looking to count a blank cell as a 0 and not count an n/a.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:jlcannon
ID: 34974203
sorry guys my last post is inaccurate. If there is any blank cells in the column I want it to retunr an incomplete so it forces then to either choose 1 or 0 or n/a and if its n/a i want it to ignore the cell and not have it factor into the %
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 34974224
Try this:

=IF(COUNT(D18:D44)=0,"Incomplete",SUM(D18:D44)/(ROWS(D18:D44)-COUNTIF(D18:D44,"N/A")))

See attached.

Kevin
Quality-RCI-Assessment-Tool-ES.xls
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 34974281
Then use this:

=IF(COUNTBLANK(D18:D47)>0,"Incomplete",SUM(D18:D47)/(ROWS(D18:D47)-COUNTIF(D18:D47,"N/A")))

See attached.

Kevin
Quality-RCI-Assessment-Tool-ES.xls
0
 

Author Comment

by:jlcannon
ID: 34974289
@zorvek,  this is comming close but it is showing me 85% but since there are blanks it should say incomplete.
0
 

Author Comment

by:jlcannon
ID: 34974446
@zorvek the post directly after the one giving me 85% worked perfect. thank you.
0
 

Author Closing Comment

by:jlcannon
ID: 34974453
Thank you. this was the exact solution I hoped to find.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel and Formulas 8 31
Outlook 2010 Archive 3 38
VBA Code Mixed Combining Two User Forms 7 38
VBA in SharePoint 3 17
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now