This thing is out of my league (SUM+lOOKUPV+INDIRECT in the same formula)

_Gandour_

New Member
Joined
Nov 16, 2017
Messages
5
Hello everyone,

Im going crazy trying to make an excel sheet that is kinda out of my league.

I have different worksheets with data arranged as follows, beggining at B5

Worksheet 1

Milk....2
Eggs...3
Yest...1

Worksheet 2

Milk....2
Eggs...3
Yest...1
Lettuce...4

My objective was to create another table that would sum the different ingredients, so i made a column with all the possible ingredients next to this crazy formula that would refer to the sheet name in a dropdown list with INDIRECT.

=SUM(LOOKUPV(D24;INDIRCT("'"&$E$5&"'!"&"B5:C26");2;0);LOOKUPV(D24;INDIRECT("'"&$E$6&"'!"&"B5:C26");2;0)


Ok, it KINDA works. Problem is, if one of the ingredients is not on both worksheets (see: Lettuce) its going to give me error instead of 4. Is there a way to fix that?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Upvote 0
Hello everyone,

Im going crazy trying to make an excel sheet that is kinda out of my league.

I have different worksheets with data arranged as follows, beggining at B5

Worksheet 1

Milk....2
Eggs...3
Yest...1

Worksheet 2

Milk....2
Eggs...3
Yest...1
Lettuce...4

My objective was to create another table that would sum the different ingredients, so i made a column with all the possible ingredients next to this crazy formula that would refer to the sheet name in a dropdown list with INDIRECT.

=SUM(LOOKUPV(D24;INDIRCT("'"&$E$5&"'!"&"B5:C26");2;0);LOOKUPV(D24;INDIRECT("'"&$E$6&"'!"&"B5:C26");2;0)


Ok, it KINDA works. Problem is, if one of the ingredients is not on both worksheets (see: Lettuce) its going to give me error instead of 4. Is there a way to fix that?

Wrap your lookups in iferror return 0. I.e, IFERROR(LOOKUPV(D24....),0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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