Reputation: 391
I am on a spreadsheet that needs to retitle cells based on the cell value and the values of the cells below it. Basically I have the below column, which is filled by a formula that links to another spreadsheet.
Column A
EE
EE
SP
EE
CH
CH
EE
SP
CH
CH
EE
EE
, and for which the cell below it is EE
, then the first cell should read "EE Only". EE
, and for which the cell below it is SP
, which is then followed by another EE
, then the first two cells should read "EE+SP". EE
where the cell(s) below it are CH
, then those cells should read "EE+CH". EE
where the cells below it are SP
and CH
, then all of those cells should read "EE+FAM".The above column should then look like:
Column A
EE Only
EE+SP
EE+SP
EE+CH
EE+CH
EE+CH
EE+FAM
EE+FAM
EE+FAM
EE+FAM
EE Only
It's a long table of values, and quite honestly I'm not even sure what the best way to go about this is.
Do I need to create a table of values to lookup against, or is there a macro that would be able to handle this?
Upvotes: 0
Views: 145
Reputation: 59440
From your input example:
=IF(AND(A2<>"EE",B1="EE+FAM"),"EE+FAM",IF(AND(A2="EE",OR(A3="EE",A3="")),"EE Only",IF(OR(AND(A1="EE",A2="SP",A3="EE"),AND(A2="EE",A3="SP",A4="EE")),"EE+SP",IF(OR(A2="CH",A3="CH"),"EE+CH",IF(AND(A2="EE",A3<>"EE"),"EE+FAM","")))))
should derive your output example.
Upvotes: 1