vlookup and return exact number of decimal places indicated in a percentage

AnnaBanana11

New Member
Joined
Aug 12, 2022
Messages
2
Office Version
  1. 2013
Hi...I've searched the internet far and wide and am unable to find a solution. I have a vlookup that returns a percentage. My issue is that the number of decimal places in the percentages vary from 0-3 and I want it returned with the ONLY the exact number of decimal places without having to change it. For example, I want 6.3% automatically displayed as 6.3%, 6.75% as 6.75%, 6.875% as 6.875%, and so on. but instead it returns my result as the cell is formatted, i.e. if I have it set to four decimal places, it returns 6.3000%, 6.7500% and 6.8750%. Is there a way to achieve what I am looking for. My vlookup is as follows:

=IFERROR(VLOOKUP(RIGHT(B8,5)+0,'[CustomerBillingInfo.xlsx]AZ Sales Tax'!$A:$B,2,FALSE),"0.00%")
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try a custom format of 0.0#%

You may need to use conditional formatting to show 0 decimal places correctly with a rule of
Excel Formula:
=MOD(cell,1)=0
and a format of 0%

I believe that this should work but I don't have laptop to hand in order to test it.
 
Upvote 0
That's it!! Who knew it could be so simple! Just needed the custom format of 0.0#%. No need for the conditional formatting. Thank you!!
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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