Forum Discussion
Help with Excel formula
Hello, I am a complete Noob, apologies for everything!
I am making a reading tracker in Excel and would like to learn how to create a formula to find the percentage of read pages vs total pages. I have my read pages in N2 and total in O2. In P2 I would like it to say 100% if the numbers are the same.
I have used this formula and it works ISH!
=(N2/O2)*100
It returns 100 in P2, BUT I would like it to...
a) say 100%
b) leave P2 blank if there are no numbers added to N2 or O2
If anyone could help me I would appreciate it.
(When I conquer this obstacle I'll be asking about percentage of times for audiobooks which is a whole new horror!)
You're off to a great start with your formula!
Here's how to modify it step by step to achieve your desired results:
=IF(OR(N2="", O2=""), "", IF(N2=O2, "100%", TEXT(N2/O2, "0%")))
Copy the formula above.
Paste it into cell P2.
Ensure that your N2 (read pages) and O2 (total pages) cells have numeric values or are left empty.
- NikolinoDEGold Contributor
You're off to a great start with your formula!
Here's how to modify it step by step to achieve your desired results:
=IF(OR(N2="", O2=""), "", IF(N2=O2, "100%", TEXT(N2/O2, "0%")))
Copy the formula above.
Paste it into cell P2.
Ensure that your N2 (read pages) and O2 (total pages) cells have numeric values or are left empty.
- noobneedshelpCopper Contributor
Thank you, you are a legend! Works perfectly!
I don't suppose you would have the answer to an audiobook version would you? Q2 is hours listened, R2 is total time, S2 would be 100%. There would be hours and minutes e.g. 7:05, 7:05, 100%
As variant
=IFERROR( (N2/N2) * (N2/O2), 1 )
In P2:
=IF(OR(N2:O2=""), "", N2/O2)
Format P2 as a percentage with 0 decimal places.
- noobneedshelpCopper Contributor
Thank you, this did solve the blank cells dilemma but returned the value as 1 instead of 100%
As I mentioned: Format P2 as a percentage with 0 decimal places.