VLOOKUP returns text instead of number

mib1019

Board Regular
Joined
Nov 9, 2017
Messages
66
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm sure I'll get an answer here.

I have a lookup table with 4 columns. Here is a screenshot:
1628791455648.png


The left column is a helper column to get VLookup to use two criteria.

My VLookup issue is in the Req'd Hrs on the data table. The formula is: =IF(ISNA(VLOOKUP([@Level]&"|"&[@Activity],Table2,4,FALSE)),0,VLOOKUP([@Level]&"|"&[@Activity],Table2,4,FALSE))
1628791601945.png


Running a pivot table on this data is returning the Req'd Hrs as text instead of a number. Doesn't make sense as the Remaining Hours column is seeing the Req'd Hrs as a number to get the result.

Hope you can help me! Thanks in advance.
MIB
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I see that your last two entries do not appear to have anything entered into that Req'd Hrs column.
Is it really blank, or is there a space in there?

Regardless, you should be able to convert your values returning numbers as text to numbers by doing a simple mathematical activity like adding 0 to it, i.e.
=IF(ISNA(VLOOKUP([@Level]&"|"&[@Activity],Table2,4,FALSE)),0,VLOOKUP([@Level]&"|"&[@Activity],Table2,4,FALSE))+0

Also, I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’). If you are using a newer version, you can use the new "IFERROR" function instead of "IF(ISNA(...".
 
Upvote 0
Thanks for that suggestion on my account details. Update. Running subscription Office 365, so the most recent version. I'll move away from the IsNA function.

The last two entries in the lookup table are blank, not spaces. There are no records, so far, in the time input table, that are looking up those blank values.

BUT...I added the '+0' to the lookup formula, and the pivot table is still seeing the Req'd Hrs value as text.

Any ideas?

Thanks for your help!
 
Upvote 0
BUT...I added the '+0' to the lookup formula, and the pivot table is still seeing the Req'd Hrs value as text.
How exactly are you determining that the value being returned is Text and not Numeric?

Are you trying to use this number in another mathematical calculations elsewhere (and is that why it is an issue)?
If so, what is the formula that references it?
 
Upvote 0
Thanks for the help. It was happening on a pivot table. I deleted it and recreated; now it is working fine.
 
Upvote 0
OK, glad you got it sorted.
 
Upvote 0
Not sure if it turned out you needed that +0 on the end but that formula can be written much more simply as
Excel Formula:
=IFNA(VLOOKUP([@Level]&"|"&[@Activity],Table2,4,FALSE),0)+0

Or an alternative formula that does not require the helper column at all in Table2, or an error check:
Excel Formula:
=SUMIFS(Table2[Req''d Hrs],Table2[Level],[@Level],Table2[Activity],[@Activity])
A further advantage of this last formula is that if subsequently columns are added/removed in Table2, the formula will not need editing as the VLOOKUP formula would (most likely).
 
Upvote 0
Solution
Not sure if it turned out you needed that +0 on the end but that formula can be written much more simply as
Excel Formula:
=IFNA(VLOOKUP([@Level]&"|"&[@Activity],Table2,4,FALSE),0)+0

Or an alternative formula that does not require the helper column at all in Table2, or an error check:
Excel Formula:
=SUMIFS(Table2[Req''d Hrs],Table2[Level],[@Level],Table2[Activity],[@Activity])
A further advantage of this last formula is that if subsequently columns are added/removed in Table2, the formula will not need editing as the VLOOKUP formula would (most likely).
Thanks everyone. I've got it solved.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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