Forum

Notifications
Clear all

Is it appropriate to use IF and INDIRECT Function for the attached sheet.

8 Posts
2 Users
0 Reactions
68 Views
(@faryal-shah)
Posts: 5
Active Member
Topic starter
 

Hello Mynda,

I am wondering if you can help me with a query.

I am preparing a project tracker, In which certain projects have sub-projects and some doesn't. I am thinking to use the following formula for validating the data in Column D of the first sheet of the attached workbook.

 

IF(INDIRECT("B6")="CO2_Storgae",N/A,IF(INDIRECT("B6")="Coal_Seam_Gas_CSG",N/A,IF(INDIRECT("B6")="Conventional_Gas",N/A,IF(INDIRECT("B6")="Geothermal_Energy",N/A,IF(INDIRECT("B6")="Prescribed_ERA_05_Alcohol_Production",N/A,IF(INDIRECT("B6")="Prescribed_ERA_10_Gas_Production",N/A,IF(INDIRECT("B6")="Prescribed_ERA_15_Fuel_Burning",N/A,IF(INDIRECT("B6")="Prescribed_ERA_28_Sugar_Milling_Refining",N/A,IF(INDIRECT("B6")="Prescribed_ERA_63_Sewage_Treatment",N/A,IF(INDIRECT("B6")="Water_Act",N/A,Select Value))))))))))

 
Posted : 01/07/2020 11:30 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Faryal,

INDIRECT definitely isn't the way to go about it. Why don't you just populate the Prescribed ERA Threshold using a lookup formula like VLOOKUP or INDEX & MATCH? It looks like there is only one outcome per primary activity. e.g. in cell D6 of the 'To be used for data entry' sheet enter this formula:

=INDEX(Table2[Prescribed ERA 06 Asphalt Manufacturing],MATCH('To be used for Data Entry'!B6,Table2[Primary Activity],0))

Mynda

 
Posted : 02/07/2020 6:09 am
(@faryal-shah)
Posts: 5
Active Member
Topic starter
 

Thank you Mynda.

 

Unfortunately, it didn't work.. It is giving me a reference error.

 

I am attaching the sheet for your perusal.

 
Posted : 03/07/2020 2:01 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Faryal,

Remove the data validation from column D in the 'To be used for data entry' sheet, then enter this formula (exactly):

=INDEX(Table2[Prescribed ERA 06 Asphalt Manufacturing],MATCH(B6,Table2[Primary Activity],1))

Your formula was missing the table name in the references.

Note: it returns zero because the cell that matches the Primary Activyt in Table2[Prescribed ERA 06 Asphalt Manufacturing] is empty.

Mynda

 
Posted : 03/07/2020 2:15 am
(@faryal-shah)
Posts: 5
Active Member
Topic starter
 

Hello Mynda,

Thank you so much for your help.

But still it isn't working as it should. I am attaching the spreadsheet again for your review.

Also, I think we need to use some other formula because for some Projects there is a list of sub projects, available in the Drop down List sheet.

Regards,

Faryal

 
Posted : 03/07/2020 10:08 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Faryal,

It looks like it's working fine to me so you'll have to be explicit about why this is wrong and what you're expecting to see instead. Also, which projects have sub projects and where is this information stored?

Mynda

 
Posted : 04/07/2020 12:37 am
(@faryal-shah)
Posts: 5
Active Member
Topic starter
 

Thank you Mynda,

I am sorry for being the pain.

 

What I am expecting to see is When somebody select any primary activity in the column D the list of relevant sub projects appear.

For instance, of ERA 07 is selected in Column B then the following corresponding list appear in column D drop down menu. All of them are available in Drop Down spread sheet.

Also, for some there are no sub projects so when these are selected automatically the word N?A appears in Column D.

I hope, I am making sense there.

Thanks and Reagrds,

Faryal

Prescribed ERA 07-(1) - Chemical Storage & Mfg
Prescribed ERA 07-(2a) - Chemical Storage & Mfg
Prescribed ERA 07-(2b) - Chemical Storage & Mfg
Prescribed ERA 07-(2c) - Chemical Storage & Mfg
Prescribed ERA 07-(3a) - Chemical Storage & Mfg
Prescribed ERA 07-(3b) - Chemical Storage & Mfg
Prescribed ERA 07-(3c) - Chemical Storage & Mfg
Prescribed ERA 07-(3d) - Chemical Storage & Mfg
Prescribed ERA 07-(4a) - Chemical Storage & Mfg
Prescribed ERA 07-(4b) - Chemical Storage & Mfg
Prescribed ERA 07-(5a) - Chemical Storage & Mfg
Prescribed ERA 07-(5b) - Chemical Storage & Mfg
Prescribed ERA 07-(5c) - Chemical Storage & Mfg
Prescribed ERA 07-(5d) - Chemical Storage & Mfg
Prescribed ERA 07-(6a) - Chemical Storage & Mfg
Prescribed ERA 07-(6b) - Chemical Storage & Mfg
Prescribed ERA 07-(6c) - Chemical Storage & Mfg
Prescribed ERA 07-(6d) - Chemical Storage & Mfg
 
Posted : 06/07/2020 10:07 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Faryal, 

I think I finally understand! You want a dependent data validation list as described here. It was confusing because you have the 'dependent lists' in the same table as the primary activities. I would have separted these to make it clear that the data across the columns is not related.

I hope that points you in the right direction.

Mynda

 
Posted : 07/07/2020 12:27 am
Share: