A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
To combine two values with different formats in a single Excel cell, you can use the TEXT function to format each part of the string separately. However, the issue you're facing with the TEXT function and the "kWh" format is likely due to the way Excel interprets the text string.
Here’s how you can achieve your desired output:
- Format the energy value correctly: Use the
TEXTfunction to format the energy value as you intended. You can use the formula:
This will format the sum of your energy values to one decimal place followed by " kWh" and concatenate it with the count of your sessions.=TEXT(SUM(range), "0.0") & " kWh in " & TEXT(COUNTA(range), "0") - Final formula: Assuming you have your energy values in a range, your final formula would look something like this:
Replace=TEXT(SUM(A1:A10), "0.0") & " kWh in " & TEXT(COUNTA(B1:B10), "0")A1:A10andB1:B10with your actual ranges.
This approach should work without giving you a #VALUE! error, as it separates the formatting of the energy value from the text string that follows it.
If you encounter any issues, ensure that the ranges you are summing and counting contain the appropriate data types (numbers for SUM and non-empty cells for COUNTA).