sumif on non contiguous cells

LFKim2018

Active Member
Joined
Mar 24, 2018
Messages
267
I have named cells A1,B2,C3,D4 as "lfk"
these cells have some values
when I used =SumIf(A1:D4,lfk)
- I didn't get anything, what is wrong with the formula?
many many thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
array (Ctrl+Shift+Enter)
=SUM(A1:D4*(ROW(A1:D4)=COLUMN(A1:D4)))

or non array (just Enter)
=SUMPRODUCT(N(OFFSET(A1,ROW(INDIRECT("1:4"))-1,ROW(INDIRECT("1:4"))-1)))
 
Upvote 0
Mr. Urtis
thank you for your prompt reply.
your formula worked.
my question is - how can I use the cell name into the formula?
is it possible?
many thanks
 
Last edited:
Upvote 0
I must not be understanding what the problem is.
Just now I named a range lfk which I defined in the Name Manager as =Sheet1!$A$1,Sheet1!$B$2,Sheet1!$C$3,Sheet1!$D$4
Then I entered the formula
=SUM(lfk)
which returned the same result as both the formulas I posted, which was what I expected.
What am I missing about what you are expecting?
 
Upvote 0
Mr. Urtis

I just received your message:

Just now I named a range lfk which I defined in the Name Manager as =Sheet1!$A$1,Sheet1!$B$2,Sheet1!$C$3,Sheet1!$D$4
Then I entered the formula
=SUM(lfk)

This is the formula I am looking for.
many many thanks

 
Upvote 0
Thanks.
I neglected to mention but you probably know, if the sheet of interest is not named Sheet1 then modify the sheet name accordingly in the Name Manager for the defined name.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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