답변 감사드립니다
지난 질문에서
아래 첨부한 식과 같이 작성하면
if condition3==false and countif(h>aa[0] and h>aa[1] ...and h>aa[20],50)>1 then 일때인데
만약 and 가 아니라
if condition3==false and countif(h>aa[0] or h>aa[1]or...h>aa[20],50)>1 처럼
or 일때는 어떻게 작성해야 할까요? 반복문으로 가능한가요?~
if Bdate!= Bdate[1] Then
Condition3 = False;
count =0;
for cnt=0to 20
{
if h > aa[cnt] Then
count = count+1;
}
if condition3==False and countif(count ==21,50)>1Then
{
condition3=true;
find(1) }
질문2)
numtostr 을 사용자 함수로 만들고 싶은데요 문자열형 형식인가요?
nt(값1,값2) 형식으로 만들고자 합니다
감사합니다
답변 1
예스스탁
예스스탁 답변
2025-06-12 13:39:40
안녕하세요
예스스탁입니다.
1
추가로 for문이 필요가 없습니다.
현재 count가 h가 aa[0]~aa[20]보다 큰 횟수를 세는 내용이고
기존에는 and로 모두 커야 하므로 count >= 21로 조건이 지정되었지만
or이면 1개만 만족해도 되므로 count >= 1로 지정하시면 됩니다.
if Bdate!= Bdate[1] Then
Condition3 = False;
count =0;
for cnt=0to 20
{
if h > aa[cnt] Then
count = count+1;
}
if condition3==False and countif(count >= 1,50)>1Then
{
condition3=true;
find(1)
}
2
numtostr는 숫자를 문자로 변환하는 함수이므로
해당갑을 최종먹으로 반환하는 사용자함수라면
반환값형도 문자열형이어야 합니다.
값1,값2를 정해서 문자를 어떻게 조합해서 반환하려고 하시는지 알수 없습니다.
함수식 안에서 NumToStr함수 원하시는 문자조합으로 리턴되게 만드셔야 합니다
2개값 더해서 문자열로 반환한다면 아래와 같습니다.
사용자함수명 : nt
반환값형 : 문자열형
input : v1(Numeric),v2(Numeric);
nt = NumToStr(v1+v2,2);
즐거운 하루되세요
> yamu 님이 쓴 글입니다.
> 제목 : 질문 부탁드립니다
> 답변 감사드립니다
지난 질문에서
아래 첨부한 식과 같이 작성하면
if condition3==false and countif(h>aa[0] and h>aa[1] ...and h>aa[20],50)>1 then 일때인데
만약 and 가 아니라
if condition3==false and countif(h>aa[0] or h>aa[1]or...h>aa[20],50)>1 처럼
or 일때는 어떻게 작성해야 할까요? 반복문으로 가능한가요?~
if Bdate!= Bdate[1] Then
Condition3 = False;
count =0;
for cnt=0to 20
{
if h > aa[cnt] Then
count = count+1;
}
if condition3==False and countif(count ==21,50)>1Then
{
condition3=true;
find(1) }
질문2)
numtostr 을 사용자 함수로 만들고 싶은데요 문자열형 형식인가요?
nt(값1,값2) 형식으로 만들고자 합니다
감사합니다