Multi-Layered lookup

Victtor

Board Regular
Joined
Jan 4, 2007
Messages
170
Office Version
  1. 365
Platform
  1. Windows
the basic formula I use is this:

=SUMIF(A:A,$A$10,B:B) in this example, $A$10 returns "Total Net Sales" and there is a dollar amount in column B

but...I need to sum all instances of $A$10 only if the cell 3 spots above each instance = "Saturday"

I hope this is clear.

the first instance of "Total Net Sales" occurs on A10. However in this case, the cell 3 spots above it, A7, contains "Thursday" so I do not want the corresponding number in Column B summed.


however,


another instance of "Total Net Sales" occurs on A97. However in this case, the cell 3 spots above it, A94, contains "Saturday" so I WANT the corresponding number in Column B summed.


The ultimate goal of this is to use the formula to sum the data for all Saturdays and all Sundays only. So if you can write the formula to extract the sales for Saturday and Sunday, I would be grateful
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Needs to be done with care:

=SUMIFS(B5:B28,A2:A25,"saturday",A5:A28,"total net sales")

where start and end cells of range specifications must offset with respect to each other.
 
Upvote 0
Needs to be done with care:

=SUMIFS(B5:B28,A2:A25,"saturday",A5:A28,"total net sales")

where start and end cells of range specifications must offset with respect to each other.

This looks like it is started in the right direction. However, I have hundreds of rows of data. How do I apply this to the entire column and sum every instance?
 
Upvote 0
Actually, I was able to make this work! thanks!

I used this version to get Saturday and Sunday:

=(SUMIFS(B5:B1303,A2:A1300,"saturday",A5:A1303,"total net sales"))+(SUMIFS(B5:B1303,A2:A1300,"Sunday",A5:A1303,"total net sales"))
 
Upvote 0
Actually, I was able to make this work! thanks!

You are welcome.

I used this version to get Saturday and Sunday:

=(SUMIFS(B5:B1303,A2:A1300,"saturday",A5:A1303,"total net sales"))+(SUMIFS(B5:B1303,A2:A1300,"Sunday",A5:A1303,"total net sales"))

You can contract that to:

=SUM(SUMIFS(B5:B1303,A2:A1300,{"saturday","sunday"},A5:A1303,"total net sales"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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