How to return the contents of a cell in a column depending on a defined row - do I use Countifs??

meagain

New Member
Joined
Dec 17, 2015
Messages
5
I successfully use :
=SUMIF($A40:$A97,B2,Z40:$Z97) to find the variable in B2 in column A and return the value from column Z.
I want to find a value from a column which varies depending on the title of the row.
i.e. Column Z has a title in row 5 as ‘Balance c/f’ and a date in row 6 as 2017. The calcs in the next three columns produce another ‘Balance c/f’ in column AD and the date is 2018 in row 6. So every 4 columns the calcs in Z are repeated.
I want to simply say… ‘find the variable in B2 in column A and return the value from a column when row 6 matches a variable which I will have in say cell f2 and in the case of column Z would be ‘2017’. But if I put ‘2018’ in cell f2 then the value in column AD would be returned…..does that make sense?
So I thought I could use:
=SUMIFS(Z40:Z97,$A40:$A97,B2,L6:AD6,f2) but that just returns #VALUE ! So am I missing something?
Secondly but not essential, how would I ensure that I choose only the column where BOTH row 5 = ‘Balance c/f’ and row 6 matches the F2 criteria?
Many thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
it would be much easier for us if you can post a small sample of your data with sensitive info deleted
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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