Sum a column of results from a VLOOKUP

  • Thread starter Thread starter Legacy 193062
  • Start date Start date
L

Legacy 193062

Guest
How can a I sum a column of results that came from a VLOOKUP?

I have a column of cells that has this formula in it:
=IF(VLOOKUP($B$4&$A9&R$8,'Sheet1'!$J$2:$T$9998,11,FALSE)="OFF", "OFF", IF(VLOOKUP($B$4&$A9&R$8,'Daily Input'!$J$2:$T$9998,11,FALSE)="BR", "OFF", IF(VLOOKUP($B$4&$A9&R$8,'Sheet1'!$J$2:$T$9998,11,FALSE)="LU", "OFF", VLOOKUP($B$4&$A9&R$8,Table1[[Date and time]:[Compliance?]],12,FALSE))))

I get results like OFF and numerical values like 0, 1, 2, 3, and 4 from the formula above.

I want to sum the column to add up the numerical values but when I sum the column with the formula SUM, the result is 0.

I know I can copy and paste special values to get rid of the formulas and yes that works but I need to keep the formulas in place.

Any help would be appreciated.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You could shorten that a little using OR and then use +0 to convert to numeric - I'm assuming that apart from "OFF", "BR", and "LU" all other values returned by the VLOOKUP are numeric?

=IF(OR(VLOOKUP($B$4&$A9&R$8,'Sheet1'!$J$2:$T$9998,11,FALSE)={"OFF","BR","LU"}),"OFF",VLOOKUP($B$4&$A9&R$8,Table1[[Date and time]:[Compliance?]],12,FALSE)+0)

Now SUM should work....
 
Upvote 0
Welcome to the board...

Sum definately does sum numbers resulting froma formula.

If Sum is returning 0, and you can see there are numbers resulting from the vlookup..
Then they are not really numbers, they are "numbers stored as text"

in the 12th column of Table1, those values are likely not really numbers.
use =ISNUMBER(Cell)
Where Cell is one of the numbers in the 12th column of Table1.

Does it return True or False?
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

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