Conditional number format?

HRIS

Board Regular
Joined
Dec 29, 2010
Messages
116
I have a cell with a vlookup formula in it for which I am wanting to change the number format if the value returned by the vlookup is less than 1. If it is less than 1, I want it to show as a percentage; if it is greater than 1, I want it to show as a flat dollar amount. Is this possible in Excel 2003? I can do it with conditional formatting in newer versions of Excel, but am not sure how to get this done in Excel 2003.

The reason I'm trying to do this is that the vlookup is pulling data from a table with flat dollar amounts or percentages. All of the percentages will be less than 100% (or less than 1) and all of the flat dollar amounts will be greater than $1.00 (or greater than 1). The vlookup is bringing over the percentages as .1 instead of the 10% showing on the table being looked up.

I appreciate any thoughts you may have!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I used an if function with a text function to do what you were requesting. The formula is below.

=IF(VLOOKUP(E2,A:B,2,FALSE)<1,TEXT(VLOOKUP(E2,A:B,2,FALSE),"0.00%"),VLOOKUP(E2,A:B,2,FALSE))
 
Upvote 0
I used an if function with a text function to do what you were requesting. The formula is below.

This worked great with the appearance, but messes with calculations based on the cell. I have some IF type calculations that if it is greater than 1, it adds it to another value; if it is less than 1, it multiplies it by that value.

Is there a way to get that to still work?
 
Upvote 0
Try the Custom Number Format
[<1] 0.00 %;$#0.00

What I wonder is what logical structure leads to a cell being either a percentage or a dollar amount?

Is the column argument of VLookup a variable?
 
Upvote 0
Try the Custom Number Format
[<1] 0.00 %;$#0.00

What I wonder is what logical structure leads to a cell being either a percentage or a dollar amount?

Is the column argument of VLookup a variable?

The custom number format worked great! Thank you both for your assistance! I wasn't aware that you could set variable conditions in custom format.

Regarding the logic, their really isn't any good logic to the % vs. flat rate. The column in which the vlookup is looking does have variable entries - some being flat rates & some being percentages. It is a table of pay grades that indicates which pay grades are eligible for shift differentials and whether it is a flat rate or % amount. The grades with % amounts are calculated on the individual's pay, while the flat rate grades are just added to the individual's pay. It has morphed over time and there is not a completely consistent reason behind which ones are flat and which are percentage. Is that what you were meaning when you asked about the logic?

This is something we are in the process of reviewing and adjusting - but will have to live with for the time being!
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
Lawrenceiow

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