Forum Discussion
Multiple IF statements, I think
I have a production run sheet with a column that indicates a clean. After the clean, when our operators enter the production unit # they are on, I need it to reference the production unit # they were on prior to the clean.
- Right now, I have a Vlookup referencing the run rate based on the item # (Column H).
- The operators manually enter the unit # they are on (Column F).
- I have an IF statement =IF(F1174<F1173,F1174,(F1174-F1173)) to calculate the hourly run rate. If they start a new product, it will take the new unit #.
- If there is a clean in column E, I would like to find a way to reference the previous unit # in column F that they were on before the clean.
PLEASE HELP 🙂
MattP817 I think i can do 1 better. If you unmerge the cells (at least in column G) then this formula can be pasted on the entire column (paste formula only to maintain other formatting):
=IFS(A6="Time","Units/Hr.",B6="PO#","Unit Rate",A6="","",NOT((A6<=2)*(A6>=0)),"",(E5>" ")*(E6=""),LET(a,XLOOKUP(C6,$C$1:$C5,$F$1:F5,0,0,-1),IF(F6<a,F6,F6-a)),F6<F5,F6,TRUE,(F6-F5))
In the attached I unmerged cells in rows 31-34 and tested it there and seems to work well. Basically instead of copy and paste each section you will be able to copy and paste on the entire column (paste formula only).
9 Replies
- mtarlerSilver Contributor
MattP817 I think this should work (untested). Basically I check if the prior had the cleaning indication and this line doesn't and then find the max row that is less than this row and is blank in the cleaning indication. I also switch to an IFS() statement but could be done as nested IF() statements.
=IFS((E1173="WTN")*(E1174=""),INDEX(F:F,MAX(ROW(F:F)*(ROW(F:F)<ROW())*(E:E=""))),F1174<F1173,F1174,TRUE,(F1174-F1173))
- MattP817Copper Contributor
mtarler So I got the formula plugged in for the 6:00 am hour to the following 5:00 am hour. When I move to the next day, it is not jumping to the line that is prior to the "WTN".
I need to subtract the light blue cell (F1184) from the red cell (F1175).
Is there a way to have the formula skip anything >"" in the E column when production resumes, but still calculate the formula in during the changeover event?
- mtarlerSilver Contributora) can you share the sheet?
b) can I assume columns C and D will be #s for non-test time?
c) looks like you need to have special condition for 5am in general.
d) I'm not sure why/how the formula is failing in the above case. From what I see I would expect it to fail because of the merged cell/line just above it but that isn't what appears to be happening
e) i assume you mean subtract red from blue (but in this case it is 0 either way). That said, if it will always be 0 (i.e. it starts up where it left off after testing) then that could make this all much easier.