Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Return sum of fraction ie 38/30

0

I need help with a formula!!

sheet1 a1 contains 38/30.

sheet2 a1 cantains =SUM(sheet1!a1)

0 gets returned Why? and how do i return 38/30 to sheet2 a1?

Answer
Discuss

Answers

0
Selected Answer

When you enter 30/38 in a cell Excel has to decide whether this is a number, a formula or text. Excel does this by elimination.

  1. It isn't a number because it contains a non-numeric character.
  2. It isn't a formula because all formulas start with an equal sign (=) which tells Excel to evaluate the formula that follows the sign.
  3. Therefore it is text.

Of course, in your case, it isn't text. 30/38 is a formula but you didn't enter the telltale leading sign. That, basically, answers your question.

You can enter =Sheet1!A1 in a cell and get exactly "30/38", meaning the same text that A1 contains. The SUM() function converts text to 0. This is, if your range includes numbers and text, the SUM() function can still draw a correct total of all numbers. But beware: =SUM("1") equals zero because "1" is text. =SUM(1,2,"3") equals 3, not be cause "3" is the last number but because "3" isn't a number.

=Sheet1!A1 will return the value found in the referenced cell. If the referenced cell contains a formula, like =30/38, then the returned value will be the evaluation of that formula, in this case 0.789473684210526. However, your cell on Sheet2 may still show 0. The reason for that would be the cell format. If the cell format displays only integers the display will be 0, same as if you entered =INT(Sheet1!A1). The difference between the two is that the cell value on Sheet2 will actually be 0 if you entered the INT() function but it will still be 0.789473684210526 if the display was tempered with. This makes a difference when you use the cell value for onward calculations.

Discuss

Discussion

Thank you very much that explains the problem. The =Sheet1!A1 does the trick but I cant seem to incorperate it into my formula. I either get a SPILL OR VALUE ERROR.
This is the formula that I am using on sheet2 and works great for 99% of the data, But doesnt work for a cell containing a entry like "38/30".

=SUMIF(Sheet1!A4:A3078,"="&TODAY(),Sheet1!D4:D3078)

Sheet1 column "A" contains a date range, Column "D" contain's Data that is entered every day. Sheet2 is a summary of all data that has been entered for the day. 
Justin2010 (rep: 8) Mar 6, '20 at 8:23 am
Justin, I can't replicate your error with either =38/30 or simple 38/30. A little research led me to this site, however, which sheds some light on your problem if you are using O365. 
Variatus (rep: 4889) Mar 6, '20 at 11:33 pm
If i try to remove =sum from the formula I get the error.
=IF(sheet1!A4:A3078,"="&TODAY(),sheet1!D4:D3078)
Is there some way to use this formula and return the text formated cells in column D without using =Sum. I read the post in the link, Do you think it may just be the O365 version?
Justin2010 (rep: 8) Mar 8, '20 at 8:27 am
It's definitely O365 which explains why I can't replicate. The link explains that the SPILL error occurs when there is more than one solution to a formula. You have found out that "38/30" causes the problem. But until now you haven't disclosed whether it's text or formula. We don't know the other data, nor the formula you try to use, nor the purpose of that formula (which might lead us to suggest alternative ways). I think the best way forward is to attach a workbook to your question that contains some actual data, demonstrates the error and explains your intentions.
Variatus (rep: 4889) Mar 8, '20 at 9:21 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login