Using &"@" with sumproduct and lookupfunctions

mishh

New Member
Joined
Apr 16, 2013
Messages
4
I have a spreadsheet where my B column was full of numbers, and my C column was where I checked off which of those numbers needed to be counted. I needed a formula that would give me the total of any number in B where the adjacent cell in C has an "x" in it. So I used this:

=SUMPRODUCT(LOOKUP(C2:C13&"@",{"","x"}&"@",{0,1}),B2:B13)

This formula works great, but I have NO idea why it worked. I copied and pasted the &"@" part from a similar formula I found online and it worked, magically as far as I can tell. I understand how the LOOKUP function is working, and even how the SUMPRODUCT function is using the desired array, I just have no clue what &"@" means. Can anyone help me out??
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
can't answer your question about the "@", but given your example you could just use SUMIF function instead
 
Upvote 0
Thanks, Danzon! That's a much more elegant (and simple!) solution. I'll probably use that instead, I didn't even think of SUMIF. But if anyone else can answer my original question anyway, just for curiosity's sake, that'd be great!
 
Upvote 0

Forum statistics

Threads
1,202,957
Messages
6,052,771
Members
444,600
Latest member
margr

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