Add a cell content to another cell if a different cell has a specific content

-2

How can I fill a cells value (e.g row 29 col A) with =sum(B1:Z1) but then only add the content of a cell in that row 29 if row 4 of that column says "UK IR". That way I can add all the cells together (for any selected row) for row 29 to cell A29, but only add the amount to this box if row 4 of any column on that row has a set value please?

I need to be able to add this to any row I want and have it work on the selected column rane I choose, and well as with the selected 'identifying' text I want.

Thanks.

Mark Nev

Posted 2015-04-19T17:08:09.693

Reputation: 19

Should be trivial using sumif – eirikdaude – 2015-04-19T20:08:54.863

What does this question have to do with auto-form-fill? – Scott – 2015-04-20T00:03:20.417

Answers

0

Not sure I totally understand the question, but I THINK you may want

=SUMIF(B4:Z4,"UK IR",B1:Z1)

which means: Sum all cells in row 1 where row 4 equals "UK IR"

Edit: In the sample file the sum formula is in cell C20 with a simple =SUM(D20:AS20)

You only want to include values in the sum where row 4 contains the text "UK IR"

So, the formula you need is a Sumif like this

=SUMIF(G4:AS4,"UK IR",G20:AS20)

which means: Sum all cells in row 20 where row 4 equals "UK IR"

teylyn

Posted 2015-04-19T17:08:09.693

Reputation: 19 551

The row at almost the top of the column has UK IR in some cells, and I want any cell below that column header to be added to my cumulative calculation. So I want to set the columns I am check and adding together, then within those columns, I only want to add to my - cell, those cells in that row (within my chosen range of columns) that have the text "UK IR" in the cell almost at the top (say row 4). I hope this makes more sense? – Mark Nev – 2015-04-19T22:46:37.243

The cell with UK IR in is at the top of the column, not in the same row as the cells I am adding together. – Mark Nev – 2015-04-19T22:54:25.620

@MarkNev Thus why she passes two different rows to the function. Have you even tried what she gave you? – eirikdaude – 2015-04-19T23:10:43.397

@MarkNev, I'm afraid your very wordy explanations are really hard to weed through. Post a screen shot or a link to a sample file. That would help. – teylyn – 2015-04-20T00:35:08.910

http://www.best-spot.co.uk/mine/Test1.rar – Mark Nev – 2015-04-20T21:57:39.960

Here is a link to a file that has a structure in it that may help it become clearer. Thank you for your time and effort. – Mark Nev – 2015-04-20T22:03:10.483

I edited my answer. It's really the same formula, just using different columns and a different row for the sum range. – teylyn – 2015-04-20T23:01:32.553

I am going to ask for more if you wouldn't mind? How do I also add into that to add weekdays only which are listed 2rows above in row 2. I only want to include Mon,Tues,Wed,Thurs,Fri to the outcome of the additions, and not include Sat, Sun please. So to be clear, I want to add the sum of row 20 together, but only cells with "UK IR" at the top of the column in row 4, and now also refine that more by only adding the cells in row 20 with a weekday name in row 2 at the top of the column. I trust that is clear? And thanks again. You are a star. – Mark Nev – 2015-04-21T22:34:23.613

Please learn how this site works. No, you cannot tack on more questions in comments. Please mark the answer. Then start a new question. – teylyn – 2015-04-22T00:34:11.623