Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 999

Getting IFERROR to move to next row if I paste a value in the previous row

$
0
0

Not sure if the title sums up my problem enough. Basically, I am attempting to streamline my data entry by using formulas. How my data is set up is I have three tabs (Sheet 1, Sheet 2, and Sheet 3). Sheet 1 is filled with basic information (age, date, sex, etc.) and each line is a "Host" and indicated by Column 1 Host_Ind. In another column I have it to be either TRUE or FALSE for SHEET 3. What I am hoping for is that when I click "TRUE" it automatically populates SHEET 3. I have figured out the following code to do that:

=IFERROR(INDEX(Host!$A$2:$A$500,SMALL(IF(TRUE=Host!$T$2:T500,ROW(Host!$A$2:$A$500),""),ROW()-1)-1,1),"")

Which successfully moves the Host_Ind to Sheet 3. The problem I am running into is on sheet three I have to copy the Host_Ind code multiple rows to indicate some behavior. I do this by copying the Host_Ind_Code and pasting "values" into the next row. I've pasted a screenshot example below on how I want my data to look like.

How Sheet 3 should lookenter image description here

How Sheet 1 (or Host Info) looks likeenter image description here

How Sheet 3 actually comes out.enter image description here

You can see that because I copied and pasted the values of Host_001, it completely skipped Host_002 and went to Host_003 even though all three hosts are "TRUE".Unfortunately, when I do that, it seems to interrupt the formula above and will not populate the next row with Host_002. Depending on how many behaviors I have, it skips the following hosts. So for the above example, I have two more behaviors, which means it'll skip two hosts and the formula will start up with Host_004 and ignore Hosts_002 and Host_003. Is there a way to edit my code above to have the formula skip rows where the values are and start the next row? I can attach a link to an example of my datasheet.

I hope this explains clearly enough what I am hoping to do! Thanks in advance.


Viewing all articles
Browse latest Browse all 999

Trending Articles