Vlookup result changing after adding iferror

lizmorton1990

New Member
Joined
Aug 19, 2020
Messages
13
Office Version
  1. 2013
Platform
  1. Windows
Hi,

I am trying to do a vlookup and I want to add an iferror in if the vlookup doesn't find anything so it looks at another cell. So far I started with this:

=vlookup(C11194,Hours!A:AC,29,0)

Which returned 08:00 to mean 8 hours of training but when that returns an error as the data doesn't exist, I want to add an iferror to the vlookup so when it says #n/a it looks at another cells on the same tab the vlookup is on i.e

=iferror(vlookup(C11194,Hours!A:AC,29,0),M11194)

But when I do it now returns 0.3333333333 which is incorrect as it should return 08:00 in this example. For the rows that return #n/a it returns the value correctly in column M

What am I doing wrong? I have tried formatting the column to auto and plain text and it doesn't help.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try

Excel Formula:
=TEXT(iferror(vlookup(C11194,Hours!A:AC,29,0),M11194),"h:mm")
 
Upvote 0
0.3333333 is the underlying values of 08:00 as XL considers a day (or 24hrs) to be 1, so 8 hours =8/24 = 0.33333..Formatting as time helps
 
Upvote 0
Thank-you, that has taken the 0.3333 away but some rows don't display the right information. I basically want to create a pivot that sums up column O for the number of training hours. Here's some screenshots of my data, I did try formatting to time which works and removes the 0.3333 and converts it to the actual minutes and hours but the pivot then doesn't show a sum of the hours, even when I highlight column O it shows 7 hours which isn't right considering each row is worth 5 hours.
 

Attachments

  • Screenshot 2024-02-29 09.09.58.jpg
    Screenshot 2024-02-29 09.09.58.jpg
    206.6 KB · Views: 7
  • Screenshot 2024-02-29 09.09.44.jpg
    Screenshot 2024-02-29 09.09.44.jpg
    152.2 KB · Views: 6
  • Screenshot 2024-02-29 09.03.46.jpg
    Screenshot 2024-02-29 09.03.46.jpg
    176.3 KB · Views: 5
  • Screenshot 2024-02-29 09.03.39.jpg
    Screenshot 2024-02-29 09.03.39.jpg
    185.3 KB · Views: 4
  • Screenshot 2024-02-29 09.03.18.jpg
    Screenshot 2024-02-29 09.03.18.jpg
    92.7 KB · Views: 5
Upvote 0
Is this a Google Sheets question or a Microsoft Excel question?
 
Upvote 0
I am using google sheets to do this one, but I didn't think formula's differed between excel and google, let me know if I am posting in the wrong place.
 
Upvote 0
That's worked thank-you!!! Something simple as well, oh well learnt something today :)
 
Upvote 0

Forum statistics

Threads
1,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

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