borntorun75
Board Regular
- Joined
- Jul 12, 2010
- Messages
- 57
I have a load of formulae in a spreadsheet. COUNTIFs, SUMIFs and some just general COUNT functions. A mixed bag. All these formulae are working on data in a named range called Table_Query_from_Data_Source. It's actually data pulled through from an MSSQL data table.
I'm tacking an extra column into the range, which is going to be a date. I'll call the column Date_Period, for ease of explanation.
Here's an example of one of my existing formula
=COUNTIF(INDEX(Table_Query_from_Data_Source,,MATCH("Product_Type",Data_Columns,0)),"=*Cars*")
It's taking the data range, searching for the column called Product_Type, and counting the number of entries that have the word 'Cars' in any of the rows. Straight forward enough.
I want to change each of the formulae I have to add in the clause 'AND/WHERE Date_Period = a date I specify'
With a bit of work, I could rewrite each formula to take account of it. It got me wondering though whether there might be a simple clause I could add into each calculation that essentially left the formula as is, but tacked on some logic which only did it where the Date_Period was also/only the one I wanted. So, it's taking account of a column, new to the formula. Something like adding an AND clause into the start/end of it.
Any thoughts, or tips to make my life simpler, or is it one where I'd have to dig into each formula ?
Thanks in advance. Using Excel 2007.
I'm tacking an extra column into the range, which is going to be a date. I'll call the column Date_Period, for ease of explanation.
Here's an example of one of my existing formula
=COUNTIF(INDEX(Table_Query_from_Data_Source,,MATCH("Product_Type",Data_Columns,0)),"=*Cars*")
It's taking the data range, searching for the column called Product_Type, and counting the number of entries that have the word 'Cars' in any of the rows. Straight forward enough.
I want to change each of the formulae I have to add in the clause 'AND/WHERE Date_Period = a date I specify'
With a bit of work, I could rewrite each formula to take account of it. It got me wondering though whether there might be a simple clause I could add into each calculation that essentially left the formula as is, but tacked on some logic which only did it where the Date_Period was also/only the one I wanted. So, it's taking account of a column, new to the formula. Something like adding an AND clause into the start/end of it.
Any thoughts, or tips to make my life simpler, or is it one where I'd have to dig into each formula ?
Thanks in advance. Using Excel 2007.