Scoring questions based on response in few columns

thirstforvba

New Member
Joined
Oct 1, 2021
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am working with an excel, which has data in several columns. Now I need to score columns 97 - 103. These columns include survey answer for a multiple choice question number 13. If a person responds to any answer between 97 to 100, it should be a score =4, if the response has column 101 or 102 included with others or as exclusive, then it should be scored 9. Response to column 103 is exclusive to begin with so anyone responding to 103 will not have a choice to answer 97 -101. So this scores 0 and this is fine. But I am having issues with developing macro for earlier 2 requirement. Irrespective the responders have answers in column 101 and 102, they are getting scored 4. I have tried multiple tweaks but I am just not getting it right. This is manual edit part of big huge fixed file which perfectly all the time except when I have twisted requests. I am not good with macros but just at basics.

This is what I have so far.

If StrComp(Sheet6.Cells(i, 103), "None") = 0 Then
Sheet2.Cells(i + 9, 7) = 0
Else
If StrComp(Sheet6.Cells(i, 97), "Phase I") = 0 Or StrComp(Sheet6.Cells(i, 98), "Phase II") = 0 Or StrComp(Sheet6.Cells(i, 99), "Phase III") = 0 Or StrComp(Sheet6.Cells(i, 100), "Phase IV") = 0 Then
Sheet2.Cells(i + 9, 7) = 4
Else
If StrComp(Sheet6.Cells(i, 97), "Phase I") = 0 Or StrComp(Sheet6.Cells(i, 98), "Phase II") = 0 Or StrComp(Sheet6.Cells(i, 99), "Phase III") = 0 Or StrComp(Sheet6.Cells(i, 100), "Phase IV") = 0 Or StrComp(Sheet6.Cells(i, 101), "Medical Device") = 0 Then
Sheet2.Cells(i + 9, 7) = 9
Else
If StrComp(Sheet6.Cells(i, 97), "Phase I") = 0 Or StrComp(Sheet6.Cells(i, 98), "Phase II") = 0 Or StrComp(Sheet6.Cells(i, 99), "Phase III") = 0 Or StrComp(Sheet6.Cells(i, 100), "Phase IV") = 0 Or StrComp(Sheet6.Cells(i, 102), "IVDR") = 0 Then
Sheet2.Cells(i + 9, 7) = 9
End If
End If
End If
End If

I have tried having medical device and IVDR in same line thus reducing second line for score 9, having them exclusively, adding 'And' rather than 'Or'. I am finally giving up. Can someone guide?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Glad to hear you got the solution.

If you would like to post the solution then it is perfectly fine to mark your post as the solution to help future readers. Otherwise, please do not mark a post that doesn't contain a solution.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top