First let me describe my data. Columns A:V are in use and the data goes down just under 500 rows. The data represents income received on securities and is broken down by several data points such as account, security identifier, major industry name, minor industry name, etc. The data has been subtotaled by a column that contains a formula that looks at the data columns and returns a string based upon the criteria. I'm trying to calculate the same values without having to have the string formula, subtotaling the data and then using VLOOKUP to find the subtotal of each grouping. Overall I've been very successful, but the issue comes up when I have to test the same column for two different text strings. After Googling for a potential solution, I came up with the following formula:
ss_MajIN is a named range that contains text strings detailing the Major Industry Name of a given security.
ss_BNIA is a named range that contains the Income Amounts to sum.
I5 is a cell that contains the text "YANKEE" which is one of the values found in the Major Industry Name column.
In this formula example, I'm only testing one possibility because testing both was not working either.
The result of the formula above is that it returns the correct amount based upon finding the string "YANKEE" in ss_MajIN but it also includes all the subtotaled amounts from the data as well, even though the cell in the ss_MajIN column of the subtotaled rows is blank. Stepping through the formula evaluator, it gives a TRUE result when comparing a "0" to "YANKEE".
Does anyone know why this might be happening? I've tried looking at a subset of the data by changing the ranges to be a smaller group of rows so that the formula evaluator is easier to follow and I get the same results. When I copied a subset of the data to another sheet and rewrote the formulas, I get the correct results. That only serves to frustrate me more. Hopefully someone can help. My work won't allow me to post to a drop-box or similar account so if the actual workbook needs to be viewed, I'll have to email it, so please PM me if you need to see the workbook.
Thanks
Code:
{=SUM(IF((ss_MajIN=$I$5),1,0)*ss_BNIA)}
ss_MajIN is a named range that contains text strings detailing the Major Industry Name of a given security.
ss_BNIA is a named range that contains the Income Amounts to sum.
I5 is a cell that contains the text "YANKEE" which is one of the values found in the Major Industry Name column.
In this formula example, I'm only testing one possibility because testing both was not working either.
The result of the formula above is that it returns the correct amount based upon finding the string "YANKEE" in ss_MajIN but it also includes all the subtotaled amounts from the data as well, even though the cell in the ss_MajIN column of the subtotaled rows is blank. Stepping through the formula evaluator, it gives a TRUE result when comparing a "0" to "YANKEE".
Does anyone know why this might be happening? I've tried looking at a subset of the data by changing the ranges to be a smaller group of rows so that the formula evaluator is easier to follow and I get the same results. When I copied a subset of the data to another sheet and rewrote the formulas, I get the correct results. That only serves to frustrate me more. Hopefully someone can help. My work won't allow me to post to a drop-box or similar account so if the actual workbook needs to be viewed, I'll have to email it, so please PM me if you need to see the workbook.
Thanks