Formula's output being seen as text instead of a number

scottatah

New Member
Joined
Dec 15, 2009
Messages
17
Hello,

I'm working with a fairly complicated spreadsheet (to me) that is growing beyond the capacity of my brain (not overly hard) and now I'm stuck. I'm no excel expert and most of the formula's I've made were with the help of the Google. I'm working in Excel 2010.

This is hard to explain, so if you have questions or I do a poor job, please ask for more info. I get daily exports of stats from an SQL database, which I import via a macro into this spreadsheet. The spreadsheet then the spreadsheet has multiple calculations to figure out percentages and averages etc.

The top 3 rows of my spreadsheet (technically rows 5, 6 and 7) calculate the average the last 5 cells inputted in the column, the last 5-10 cells and the last 10-15 cells. Below is an example of the last 5 cells/days worth of data in this column (I'll refer to this is formula A):
=AVERAGEIF((OFFSET(JB49,COUNT(JB49:JB999)-5,0,5,1)),">0")
JB49 is where my data for this column starts.

This formula works fine in most columns, except for the ones with percentages, as I've got an issue with the count function in the above formula. It's not counting all of my cells and I think I've figured out why.

Each cell in column JB uses the following formula and all cells are by default percentage cells ('ll refer to this as formula B):
=IF(JA43="","",IF(IY43="","",IF(ISERROR(JA43/IY43),"0.0%",JA43/IY43)))
Basically, it divides JA43/IY43, but if either number is blank it makes the target cell blank (this leaves the cell blank, if there's missing data (aka future dates worth of data)). In addition, if the formula tries to divide by zero and results in a DIV/0 error, it outputs 0.0% instead. This 0.0% is my problem and it happens whenever a staff member is away and gets 0's as they performed no work.

The count function in formula A see's the 0.0% outputted from formula B as text instead of a number. The count function in turn doesn't count the cell, and my averages for the last 5, 5-10, 10-15 days are then skewed.

I've reduced formula A to just the count function and confirmed that if I replace the 0.0% obtained by formula B with manually typing in 0.0%, the count function then works properly, return the correct count.

What can I do to correct formula B to have 0.0% represented as a number instead of text according to excel.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
If you surround a value with quotes it is text. Try:

=IF(JA43="","",IF(IY43="","",IF(ISERROR(JA43/IY43),0,JA43/IY43)))
 
Upvote 0
Awe man...you guys make this so seem so simple. That simple fix just prevented my head from exploding. Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top